]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commit
ceph: don't leak snap_rwsem in handle_cap_grant
authorJeff Layton <jlayton@kernel.org>
Fri, 3 Jun 2022 20:04:01 +0000 (16:04 -0400)
committerJeff Layton <jlayton@kernel.org>
Fri, 3 Jun 2022 20:07:43 +0000 (16:07 -0400)
commita7836bad6c71b15d459715c02d3169cd8441ba8b
treee004669fb792f62d053c286b732d3c852d3fadb2
parent4168fe3b02d641c71852b274e8594dc697a031cb
ceph: don't leak snap_rwsem in handle_cap_grant

When handle_cap_grant is called on an IMPORT op, then the snap_rwsem is
held and the function is expected to release it before returning. It
currently fails to do that which could lead to a deadlock.

Ensure it releases the snap_rwsem if this is an IMPORT op.

URL: https://tracker.ceph.com/issues/55857
Signed-off-by: Jeff Layton <jlayton@kernel.org>
fs/ceph/caps.c