diff options
author | Yan, Zheng <zyan@redhat.com> | 2015-12-17 02:36:39 -0500 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2016-01-21 13:36:07 -0500 |
commit | f9cac5ac08b630c87c56671ce99a80310cffb2c6 (patch) | |
tree | fcdc748ac9457010afaf69c8576a13cabc989ca1 /fs/ceph | |
parent | 1761b22966e61494f51be76bc3b10e9c1ff809ad (diff) |
ceph: fix double page_unlock() in page_mkwrite()
ceph_update_writeable_page() unlocks the page on errors, so
page_mkwrite() should not unlock the page again.
Signed-off-by: Yan, Zheng <zyan@redhat.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/addr.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index b7d218a168fb..ce3c773726c5 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c | |||
@@ -1378,11 +1378,13 @@ static int ceph_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
1378 | 1378 | ||
1379 | ret = VM_FAULT_NOPAGE; | 1379 | ret = VM_FAULT_NOPAGE; |
1380 | if ((off > size) || | 1380 | if ((off > size) || |
1381 | (page->mapping != inode->i_mapping)) | 1381 | (page->mapping != inode->i_mapping)) { |
1382 | unlock_page(page); | ||
1382 | goto out; | 1383 | goto out; |
1384 | } | ||
1383 | 1385 | ||
1384 | ret = ceph_update_writeable_page(vma->vm_file, off, len, page); | 1386 | ret = ceph_update_writeable_page(vma->vm_file, off, len, page); |
1385 | if (ret == 0) { | 1387 | if (ret >= 0) { |
1386 | /* success. we'll keep the page locked. */ | 1388 | /* success. we'll keep the page locked. */ |
1387 | set_page_dirty(page); | 1389 | set_page_dirty(page); |
1388 | ret = VM_FAULT_LOCKED; | 1390 | ret = VM_FAULT_LOCKED; |
@@ -1393,8 +1395,6 @@ static int ceph_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
1393 | ret = VM_FAULT_SIGBUS; | 1395 | ret = VM_FAULT_SIGBUS; |
1394 | } | 1396 | } |
1395 | out: | 1397 | out: |
1396 | if (ret != VM_FAULT_LOCKED) | ||
1397 | unlock_page(page); | ||
1398 | if (ret == VM_FAULT_LOCKED || | 1398 | if (ret == VM_FAULT_LOCKED || |
1399 | ci->i_inline_version != CEPH_INLINE_NONE) { | 1399 | ci->i_inline_version != CEPH_INLINE_NONE) { |
1400 | int dirty; | 1400 | int dirty; |