diff options
author | Yan, Zheng | 2014-09-17 07:45:12 +0800 |
---|---|---|
committer | Ilya Dryomov | 2014-10-14 21:03:39 +0400 |
commit | 6cd3bcad0d269f96667ea704d4f6459a5c6ccbab (patch) | |
tree | b1b9f47e26f0553902803e7e58d23a0a3d3b5b0b /fs/ceph/caps.c | |
parent | 508b32d8661b12da4c9ca41a9b2054e1dc92fa7e (diff) |
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/caps.c')
-rw-r--r-- | fs/ceph/caps.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 6d1cd45dca89..b3b0a913589f 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -3045,6 +3045,12 @@ void ceph_handle_caps(struct ceph_mds_session *session, } } + /* lookup ino */ + inode = ceph_find_inode(sb, vino); + ci = ceph_inode(inode); + dout(" op %s ino %llx.%llx inode %p\n", ceph_cap_op_name(op), vino.ino, + vino.snap, inode); + mutex_lock(&session->s_mutex); session->s_seq++; dout(" mds%d seq %lld cap seq %u\n", session->s_mds, session->s_seq, @@ -3053,11 +3059,6 @@ void ceph_handle_caps(struct ceph_mds_session *session, if (op == CEPH_CAP_OP_IMPORT) ceph_add_cap_releases(mdsc, session); - /* lookup ino */ - inode = ceph_find_inode(sb, vino); - ci = ceph_inode(inode); - dout(" op %s ino %llx.%llx inode %p\n", ceph_cap_op_name(op), vino.ino, - vino.snap, inode); if (!inode) { dout(" i don't have ino %llx\n", vino.ino); |