Commit c1d00b2d authored by Taesoo Kim's avatar Taesoo Kim Committed by Ilya Dryomov

ceph: properly release page upon error

When ceph_update_writeable_page fails (including -EAGAIN), it
unlocks (w/ unlock_page) the page but does not 'release'
(w/ page_cache_release) properly.

Upon error, properly set *pagep to NULL, indicating an error.
Signed-off-by: default avatarTaesoo Kim <tsgatesv@gmail.com>
Signed-off-by: default avatarYan, Zheng <zyan@redhat.com>
parent 1fe48023
......@@ -1146,6 +1146,10 @@ static int ceph_write_begin(struct file *file, struct address_space *mapping,
inode, page, (int)pos, (int)len);
r = ceph_update_writeable_page(file, pos, len, page);
if (r < 0)
page_cache_release(page);
else
*pagep = page;
} while (r == -EAGAIN);
return r;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment