Commit f0b33df5 authored by Yan, Zheng's avatar Yan, Zheng Committed by Ilya Dryomov

ceph: handle -EAGAIN returned by ceph_update_writeable_page()

when ceph_update_writeable_page() return -EAGAIN, caller should
lock the page and call ceph_update_writeable_page() again.
Signed-off-by: default avatarYan, Zheng <zyan@redhat.com>
parent 6ce026e4
...@@ -1475,21 +1475,23 @@ static int ceph_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) ...@@ -1475,21 +1475,23 @@ static int ceph_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
/* Update time before taking page lock */ /* Update time before taking page lock */
file_update_time(vma->vm_file); file_update_time(vma->vm_file);
lock_page(page); do {
lock_page(page);
if ((off > size) || (page->mapping != inode->i_mapping)) { if ((off > size) || (page->mapping != inode->i_mapping)) {
unlock_page(page); unlock_page(page);
ret = VM_FAULT_NOPAGE; ret = VM_FAULT_NOPAGE;
goto out; break;
} }
ret = ceph_update_writeable_page(vma->vm_file, off, len, page);
if (ret >= 0) {
/* success. we'll keep the page locked. */
set_page_dirty(page);
ret = VM_FAULT_LOCKED;
}
} while (ret == -EAGAIN);
ret = ceph_update_writeable_page(vma->vm_file, off, len, page);
if (ret >= 0) {
/* success. we'll keep the page locked. */
set_page_dirty(page);
ret = VM_FAULT_LOCKED;
}
out:
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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment