OSDN Git Service

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)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 2 Aug 2022 22:54:12 +0000 (00:54 +0200)
commit58dd4385577ed7969b80cdc9e2a31575aba6c712
tree93d2fb4eaff76211891d889187345e6a9029e8c1
parentd93231a6bc8a452323d5fef16cca7107ce483a27
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: 6f05b30ea063 ("ceph: reset i_requested_max_size if file write is not wanted")
Link: 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: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/caps.c