Skip to content

Commit

Permalink
ceph: fix double page_unlock() in page_mkwrite()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yan, Zheng authored and Ilya Dryomov committed Jan 21, 2016
1 parent 1761b22 commit f9cac5a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fs/ceph/addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit f9cac5a

Please sign in to comment.