]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
ceph: clean up locking annotation for ceph_get_snap_realm and __lookup_snap_realm
authorJeff Layton <jlayton@kernel.org>
Tue, 1 Jun 2021 13:24:38 +0000 (09:24 -0400)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 24 Sep 2021 10:27:38 +0000 (12:27 +0200)
commit7dd928e41233016956ac1d01a23486aaebd2acdd
treece477cc9f9cff122a98bfbc7c351d7bfc1659596
parent484a4c5b8d9e2ff6cc7be9259e897e55f7dc992f
ceph: clean up locking annotation for ceph_get_snap_realm and __lookup_snap_realm

BugLink: https://bugs.launchpad.net/bugs/1944202
commit df2c0cb7f8e8c83e495260ad86df8c5da947f2a7 upstream.

They both say that the snap_rwsem must be held for write, but I don't
see any real reason for it, and it's not currently always called that
way.

The lookup is just walking the rbtree, so holding it for read should be
fine there. The "get" is bumping the refcount and (possibly) removing
it from the empty list. I see no need to hold the snap_rwsem for write
for that.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
fs/ceph/snap.c