aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2012-01-03 13:09:07 -0500
committerSage Weil <sage@newdream.net>2012-01-10 11:57:02 -0500
commit2ff179e650e95c2b21841b21dc46dc2edefd04cd (patch)
tree9b15ba73039053111d73da96227e1589b3f11ff2 /fs/ceph
parentee6b1baf67591b6d7ce1a6a07544343433d5ec9e (diff)
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 <sage@newdream.net>
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/dir.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index a421555b229d..974ef1e4d268 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,
1218 do { 1218 do {
1219 ceph_mdsc_get_request(req); 1219 ceph_mdsc_get_request(req);
1220 spin_unlock(&ci->i_unsafe_lock); 1220 spin_unlock(&ci->i_unsafe_lock);
1221
1221 dout("dir_fsync %p wait on tid %llu (until %llu)\n", 1222 dout("dir_fsync %p wait on tid %llu (until %llu)\n",
1222 inode, req->r_tid, last_tid); 1223 inode, req->r_tid, last_tid);
1223 if (req->r_timeout) { 1224 if (req->r_timeout) {
@@ -1230,9 +1231,9 @@ static int ceph_dir_fsync(struct file *file, loff_t start, loff_t end,
1230 } else { 1231 } else {
1231 wait_for_completion(&req->r_safe_completion); 1232 wait_for_completion(&req->r_safe_completion);
1232 } 1233 }
1233 spin_lock(&ci->i_unsafe_lock);
1234 ceph_mdsc_put_request(req); 1234 ceph_mdsc_put_request(req);
1235 1235
1236 spin_lock(&ci->i_unsafe_lock);
1236 if (ret || list_empty(head)) 1237 if (ret || list_empty(head))
1237 break; 1238 break;
1238 req = list_entry(head->next, 1239 req = list_entry(head->next,