diff options
author | Taesoo Kim <tsgatesv@gmail.com> | 2015-03-20 17:36:56 -0400 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2015-04-20 11:55:34 -0400 |
commit | c1d00b2d9c4fc821e33c5cdfbdbc32677cb0e2e0 (patch) | |
tree | 619b91acc56d2f807fdd979db42b226321e19ae8 /fs/ceph | |
parent | 1fe480235ad7236e8ea6c167af5a5d1ac24f8a88 (diff) |
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>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/addr.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index fd5599d32362..e723482c5f37 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c | |||
@@ -1146,6 +1146,10 @@ static int ceph_write_begin(struct file *file, struct address_space *mapping, | |||
1146 | inode, page, (int)pos, (int)len); | 1146 | inode, page, (int)pos, (int)len); |
1147 | 1147 | ||
1148 | r = ceph_update_writeable_page(file, pos, len, page); | 1148 | r = ceph_update_writeable_page(file, pos, len, page); |
1149 | if (r < 0) | ||
1150 | page_cache_release(page); | ||
1151 | else | ||
1152 | *pagep = page; | ||
1149 | } while (r == -EAGAIN); | 1153 | } while (r == -EAGAIN); |
1150 | 1154 | ||
1151 | return r; | 1155 | return r; |