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

Commit 8f883c24 authored by Sage Weil's avatar Sage Weil
Browse files

ceph: make write_begin wait propagate ERESTARTSYS



Currently, if the wait_event_interruptible is interrupted, we
return EAGAIN unconditionally and loop, such that we aren't, in
fact, interruptible.  So, propagate ERESTARTSYS if we get it.

Signed-off-by: default avatarSage Weil <sage@newdream.net>
parent ec4318bc
Loading
Loading
Loading
Loading
+8 −2
Original line number Original line Diff line number Diff line
@@ -919,6 +919,10 @@ static int context_is_writeable_or_written(struct inode *inode,
/*
/*
 * We are only allowed to write into/dirty the page if the page is
 * We are only allowed to write into/dirty the page if the page is
 * clean, or already dirty within the same snap context.
 * clean, or already dirty within the same snap context.
 *
 * called with page locked.
 * return success with page locked,
 * or any failure (incl -EAGAIN) with page unlocked.
 */
 */
static int ceph_update_writeable_page(struct file *file,
static int ceph_update_writeable_page(struct file *file,
			    loff_t pos, unsigned len,
			    loff_t pos, unsigned len,
@@ -961,9 +965,11 @@ retry_locked:
			snapc = ceph_get_snap_context((void *)page->private);
			snapc = ceph_get_snap_context((void *)page->private);
			unlock_page(page);
			unlock_page(page);
			ceph_queue_writeback(inode);
			ceph_queue_writeback(inode);
			wait_event_interruptible(ci->i_cap_wq,
			r = wait_event_interruptible(ci->i_cap_wq,
			       context_is_writeable_or_written(inode, snapc));
			       context_is_writeable_or_written(inode, snapc));
			ceph_put_snap_context(snapc);
			ceph_put_snap_context(snapc);
			if (r == -ERESTARTSYS)
				return r;
			return -EAGAIN;
			return -EAGAIN;
		}
		}