diff options
author | Yan, Zheng <zyan@redhat.com> | 2015-12-17 15:36:39 +0800 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2016-01-21 19:36:07 +0100 |
commit | f9cac5ac08b630c87c56671ce99a80310cffb2c6 (patch) | |
tree | fcdc748ac9457010afaf69c8576a13cabc989ca1 /fs/ceph/addr.c | |
parent | 1761b22966e61494f51be76bc3b10e9c1ff809ad (diff) | |
download | op-kernel-dev-f9cac5ac08b630c87c56671ce99a80310cffb2c6.zip op-kernel-dev-f9cac5ac08b630c87c56671ce99a80310cffb2c6.tar.gz |
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/addr.c')
-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 b7d218a..ce3c773 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) ret = VM_FAULT_NOPAGE; if ((off > size) || - (page->mapping != inode->i_mapping)) + (page->mapping != inode->i_mapping)) { + unlock_page(page); goto out; + } ret = ceph_update_writeable_page(vma->vm_file, off, len, page); - if (ret == 0) { + if (ret >= 0) { /* success. we'll keep the page locked. */ set_page_dirty(page); ret = VM_FAULT_LOCKED; @@ -1393,8 +1395,6 @@ static int ceph_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) ret = VM_FAULT_SIGBUS; } out: - if (ret != VM_FAULT_LOCKED) - unlock_page(page); if (ret == VM_FAULT_LOCKED || ci->i_inline_version != CEPH_INLINE_NONE) { int dirty; |