summaryrefslogtreecommitdiffstats
path: root/fs/ceph/mds_client.c
diff options
context:
space:
mode:
authorYan, Zheng2014-09-17 01:45:12 +0200
committerIlya Dryomov2014-10-14 19:03:39 +0200
commit6cd3bcad0d269f96667ea704d4f6459a5c6ccbab (patch)
treeb1b9f47e26f0553902803e7e58d23a0a3d3b5b0b /fs/ceph/mds_client.c
parentceph: request xattrs if xattr_version is zero (diff)
downloadkernel-qcow2-linux-6cd3bcad0d269f96667ea704d4f6459a5c6ccbab.tar.gz
kernel-qcow2-linux-6cd3bcad0d269f96667ea704d4f6459a5c6ccbab.tar.xz
kernel-qcow2-linux-6cd3bcad0d269f96667ea704d4f6459a5c6ccbab.zip
ceph: move ceph_find_inode() outside the s_mutex
ceph_find_inode() may wait on freeing inode, using it inside the s_mutex may cause deadlock. (the freeing inode is waiting for OSD read reply, but dispatch thread is blocked by the s_mutex) Signed-off-by: Yan, Zheng <zyan@redhat.com> Reviewed-by: Sage Weil <sage@redhat.com>
Diffstat (limited to 'fs/ceph/mds_client.c')
-rw-r--r--fs/ceph/mds_client.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index a17fc49c9948..5edf206354b2 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -2944,14 +2944,15 @@ static void handle_lease(struct ceph_mds_client *mdsc,
if (dname.len != get_unaligned_le32(h+1))
goto bad;
- mutex_lock(&session->s_mutex);
- session->s_seq++;
-
/* lookup inode */
inode = ceph_find_inode(sb, vino);
dout("handle_lease %s, ino %llx %p %.*s\n",
ceph_lease_op_name(h->action), vino.ino, inode,
dname.len, dname.name);
+
+ mutex_lock(&session->s_mutex);
+ session->s_seq++;
+
if (inode == NULL) {
dout("handle_lease no inode %llx\n", vino.ino);
goto release;