Skip to contentSkip to conversation

ceph: Avoid to propagate the invalid page point

PATCH Applied Minfei Huang 2 participants 2 messages Dec 19, 2015 – Dec 21, 2015 Ceph client

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ceph: Avoid to propagate the invalid page point

The variant pagep will still get the invalid page point, although ceph fails in function ceph_update_writeable_page.

To fix this issue, Assigne the page to pagep until there is no failure in function ceph_update_writeable_page.

---
 fs/ceph/addr.c | 1 -
 1 file changed, 1 deletion(-)
fs/ceph/addr.c +0 -1
index b7d218a..6491079 100644
@@ -1149,7 +1149,6 @@ static int ceph_write_begin(struct file *file, struct address_space *mapping,
 		page = grab_cache_page_write_begin(mapping, index, 0);
 		if (!page)
 			return -ENOMEM;
-		*pagep = page;
 
 		dout("write_begin file %p inode %p page %p %d~%d\n", file,
 		     inode, page, (int)pos, (int)len);
Signature · 1 line
2.6.3
Applied
#1 lore raw
Quoted 19 lines · Minfei Huang

The variant pagep will still get the invalid page point, although ceph fails in function ceph_update_writeable_page.

To fix this issue, Assigne the page to pagep until there is no failure in function ceph_update_writeable_page.

---
fs/ceph/addr.c | 1 -

1 file changed, 1 deletion(-)
fs/ceph/addr.c +0 -0
index b7d218a..6491079 100644

fs/ceph/addr.c static int ceph_write_begin(struct file *file, struct address_space *mapping, · line 1154

Quoted 7 lines
fs/ceph/addr.c +0 -1
@@ -1149,7 +1149,6 @@ static int ceph_write_begin(struct file *file, struct address_space *mapping,
 		page = grab_cache_page_write_begin(mapping, index, 0);
 		if (!page)
 			return -ENOMEM;
-		*pagep = page;
 
 		dout("write_begin file %p inode %p page %p %d~%d\n", file,
 		     inode, page, (int)pos, (int)len);

applied, thanks

Yan, Zheng

Quoted 3 lines
Signature · 1 line
2.6.3