Commit 7f47f7f
ceph: get snap_rwsem read lock in handle_cap_export for ceph_add_cap
ceph_add_cap says in its function documentation that the caller should
hold the read lock on the session snap_rwsem. Furthermore, not only
ceph_add_cap needs that lock, when it calls to ceph_lookup_snap_realm it
eventually calls ceph_get_snap_realm which states via lockdep that
snap_rwsem needs to be held. handle_cap_export calls ceph_add_cap
without that mdsc->snap_rwsem held. Thus, since ceph_get_snap_realm
and ceph_add_cap both need the lock, the common place to acquire that
lock is inside handle_cap_export.
Signed-off-by: Niels Dossche <dossche.niels@gmail.com>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>1 parent dc9b0dc commit 7f47f7f
1 file changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3870 | 3870 | | |
3871 | 3871 | | |
3872 | 3872 | | |
| 3873 | + | |
3873 | 3874 | | |
3874 | 3875 | | |
3875 | 3876 | | |
| |||
3933 | 3934 | | |
3934 | 3935 | | |
3935 | 3936 | | |
| 3937 | + | |
3936 | 3938 | | |
3937 | 3939 | | |
3938 | 3940 | | |
| |||
3958 | 3960 | | |
3959 | 3961 | | |
3960 | 3962 | | |
| 3963 | + | |
3961 | 3964 | | |
3962 | 3965 | | |
3963 | 3966 | | |
| |||
0 commit comments