Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f9cac5ac authored by Yan, Zheng's avatar Yan, Zheng Committed by Ilya Dryomov
Browse files

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: default avatarYan, Zheng <zyan@redhat.com>
parent 1761b229
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -1378,11 +1378,13 @@ static int ceph_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)


	ret = VM_FAULT_NOPAGE;
	ret = VM_FAULT_NOPAGE;
	if ((off > size) ||
	if ((off > size) ||
	    (page->mapping != inode->i_mapping))
	    (page->mapping != inode->i_mapping)) {
		unlock_page(page);
		goto out;
		goto out;
	}


	ret = ceph_update_writeable_page(vma->vm_file, off, len, page);
	ret = ceph_update_writeable_page(vma->vm_file, off, len, page);
	if (ret == 0) {
	if (ret >= 0) {
		/* success.  we'll keep the page locked. */
		/* success.  we'll keep the page locked. */
		set_page_dirty(page);
		set_page_dirty(page);
		ret = VM_FAULT_LOCKED;
		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;
			ret = VM_FAULT_SIGBUS;
	}
	}
out:
out:
	if (ret != VM_FAULT_LOCKED)
		unlock_page(page);
	if (ret == VM_FAULT_LOCKED ||
	if (ret == VM_FAULT_LOCKED ||
	    ci->i_inline_version != CEPH_INLINE_NONE) {
	    ci->i_inline_version != CEPH_INLINE_NONE) {
		int dirty;
		int dirty;