From: Sage Weil Date: Tue, 3 Jan 2012 18:09:07 +0000 (-0800) Subject: ceph: avoid iput() while holding spinlock in ceph_dir_fsync X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2ff179e650e95c2b21841b21dc46dc2edefd04cd;p=mv-sheeva.git ceph: avoid iput() while holding spinlock in ceph_dir_fsync ceph_mdsc_put_request() can call iput(), which can sleep. Don't do that. Fixes: #1812 Signed-off-by: Sage Weil --- diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index a421555b229..974ef1e4d26 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c @@ -1218,6 +1218,7 @@ static int ceph_dir_fsync(struct file *file, loff_t start, loff_t end, do { ceph_mdsc_get_request(req); spin_unlock(&ci->i_unsafe_lock); + dout("dir_fsync %p wait on tid %llu (until %llu)\n", inode, req->r_tid, last_tid); if (req->r_timeout) { @@ -1230,9 +1231,9 @@ static int ceph_dir_fsync(struct file *file, loff_t start, loff_t end, } else { wait_for_completion(&req->r_safe_completion); } - spin_lock(&ci->i_unsafe_lock); ceph_mdsc_put_request(req); + spin_lock(&ci->i_unsafe_lock); if (ret || list_empty(head)) break; req = list_entry(head->next,