Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Jeff Layton and committed by
Ilya Dryomov
27171ae6 13311e74

+5
+3
fs/ceph/file.c
··· 578 578 struct ceph_inode_info *ci = ceph_inode(dir); 579 579 struct inode *inode; 580 580 struct timespec64 now; 581 + struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(dir->i_sb); 581 582 struct ceph_vino vino = { .ino = req->r_deleg_ino, 582 583 .snap = CEPH_NOSNAP }; 583 584 ··· 616 615 617 616 ceph_file_layout_to_legacy(lo, &in.layout); 618 617 618 + down_read(&mdsc->snap_rwsem); 619 619 ret = ceph_fill_inode(inode, NULL, &iinfo, NULL, req->r_session, 620 620 req->r_fmode, NULL); 621 + up_read(&mdsc->snap_rwsem); 621 622 if (ret) { 622 623 dout("%s failed to fill inode: %d\n", __func__, ret); 623 624 ceph_dir_clear_complete(dir);
+2
fs/ceph/inode.c
··· 777 777 umode_t mode = le32_to_cpu(info->mode); 778 778 dev_t rdev = le32_to_cpu(info->rdev); 779 779 780 + lockdep_assert_held(&mdsc->snap_rwsem); 781 + 780 782 dout("%s %p ino %llx.%llx v %llu had %llu\n", __func__, 781 783 inode, ceph_vinop(inode), le64_to_cpu(info->version), 782 784 ci->i_version);