]> git.apps.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:39:57 +0000 (16:39 -0400)
committerXiubo Li <xiubli@redhat.com>
Mon, 6 Jun 2022 11:51:42 +0000 (19:51 +0800)
commit06546af02902b198b3f67e1a3aa37ae43895f437
tree8c1c10ff13c66c169bfeb7c98aa12e8bcad9ec34
parentdea94541077519a9c62dba9f980b1509e5a52872
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 in all cases which could lead to a deadlock.

Fixes: 6f05b30ea063a2 (ceph: reset i_requested_max_size if file write is not wanted)
URL: https://tracker.ceph.com/issues/55857
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Luís Henriques <lhenriques@suse.de>
Signed-off-by: Xiubo Li <xiubli@redhat.com>
fs/ceph/caps.c