summaryrefslogtreecommitdiffstats
path: root/fs/ceph/inode.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@kernel.org>2021-06-01 09:40:25 -0400
committerIlya Dryomov <idryomov@gmail.com>2021-06-22 13:53:28 +0200
commit27171ae6a0fdc75571e5bf3d0961631a1e4fb765 (patch)
tree110d0dc1ca33573d9a58637cabb45b0bdd474550 /fs/ceph/inode.c
parent13311e74253fe64329390df80bed3f07314ddd61 (diff)
downloadlinux-27171ae6a0fdc75571e5bf3d0961631a1e4fb765.tar.gz
linux-27171ae6a0fdc75571e5bf3d0961631a1e4fb765.tar.bz2
linux-27171ae6a0fdc75571e5bf3d0961631a1e4fb765.zip
ceph: must hold snap_rwsem when filling inode for async create
...and add a lockdep assertion for it to ceph_fill_inode(). Cc: stable@vger.kernel.org # v5.7+ Fixes: 9a8d03ca2e2c3 ("ceph: attempt to do async create when possible") Signed-off-by: Jeff Layton <jlayton@kernel.org> Reviewed-by: Ilya Dryomov <idryomov@gmail.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/inode.c')
-rw-r--r--fs/ceph/inode.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index e1c63adb196d..df0c8a724609 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -777,6 +777,8 @@ int ceph_fill_inode(struct inode *inode, struct page *locked_page,
umode_t mode = le32_to_cpu(info->mode);
dev_t rdev = le32_to_cpu(info->rdev);
+ lockdep_assert_held(&mdsc->snap_rwsem);
+
dout("%s %p ino %llx.%llx v %llu had %llu\n", __func__,
inode, ceph_vinop(inode), le64_to_cpu(info->version),
ci->i_version);