summaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
authorJeff Layton <jlayton@kernel.org>2021-06-09 20:01:52 +0200
committerIlya Dryomov <idryomov@gmail.com>2021-06-29 00:15:52 +0200
commit0449a35222e97efe05cd00885bfe4a6924dee5c7 (patch)
tree3a0d04a41434ffbbe9e958987460dae1931f8b8f /fs/ceph
parentceph: don't take s_mutex or snap_rwsem in ceph_check_caps (diff)
downloadlinux-0449a35222e97efe05cd00885bfe4a6924dee5c7.tar.xz
linux-0449a35222e97efe05cd00885bfe4a6924dee5c7.zip
ceph: don't take s_mutex in try_flush_caps
The s_mutex doesn't protect anything in this codepath. Signed-off-by: Jeff Layton <jlayton@kernel.org> Reviewed-by: Luis Henriques <lhenriques@suse.de> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/caps.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 95f56b377312..6fae3cb6d5f3 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -2146,26 +2146,17 @@ static int try_flush_caps(struct inode *inode, u64 *ptid)
{
struct ceph_mds_client *mdsc = ceph_sb_to_client(inode->i_sb)->mdsc;
struct ceph_inode_info *ci = ceph_inode(inode);
- struct ceph_mds_session *session = NULL;
int flushing = 0;
u64 flush_tid = 0, oldest_flush_tid = 0;
-retry:
spin_lock(&ci->i_ceph_lock);
retry_locked:
if (ci->i_dirty_caps && ci->i_auth_cap) {
struct ceph_cap *cap = ci->i_auth_cap;
struct cap_msg_args arg;
+ struct ceph_mds_session *session = cap->session;
- if (session != cap->session) {
- spin_unlock(&ci->i_ceph_lock);
- if (session)
- mutex_unlock(&session->s_mutex);
- session = cap->session;
- mutex_lock(&session->s_mutex);
- goto retry;
- }
- if (cap->session->s_state < CEPH_MDS_SESSION_OPEN) {
+ if (session->s_state < CEPH_MDS_SESSION_OPEN) {
spin_unlock(&ci->i_ceph_lock);
goto out;
}
@@ -2202,9 +2193,6 @@ retry_locked:
spin_unlock(&ci->i_ceph_lock);
}
out:
- if (session)
- mutex_unlock(&session->s_mutex);
-
*ptid = flush_tid;
return flushing;
}