ceph: Avoid to propagate the invalid page point
authorMinfei Huang <mnfhuang@gmail.com>
Sat, 19 Dec 2015 02:54:59 +0000 (10:54 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Thu, 21 Jan 2016 18:36:07 +0000 (19:36 +0100)
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.

Signed-off-by: Minfei Huang <mnfhuang@gmail.com>
Signed-off-by: Yan, Zheng <zyan@redhat.com>
fs/ceph/addr.c

index ce3c773726c53a9c80adfad5e8ee235dd9cc5a11..6dfff0ba4d980253e635d859cf3a521a8e976712 100644 (file)
@@ -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);