mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-04 16:15:11 +00:00
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: Taesoo Kim <tsgatesv@gmail.com> Signed-off-by: Yan, Zheng <zyan@redhat.com>
This commit is contained in:
parent
1fe480235a
commit
c1d00b2d9c
1 changed files with 4 additions and 0 deletions
|
@ -1146,6 +1146,10 @@ static int ceph_write_begin(struct file *file, struct address_space *mapping,
|
||||||
inode, page, (int)pos, (int)len);
|
inode, page, (int)pos, (int)len);
|
||||||
|
|
||||||
r = ceph_update_writeable_page(file, pos, len, page);
|
r = ceph_update_writeable_page(file, pos, len, page);
|
||||||
|
if (r < 0)
|
||||||
|
page_cache_release(page);
|
||||||
|
else
|
||||||
|
*pagep = page;
|
||||||
} while (r == -EAGAIN);
|
} while (r == -EAGAIN);
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
|
|
Loading…
Reference in a new issue