From: Linus Torvalds Date: Thu, 9 Sep 2021 18:39:57 +0000 (-0700) Subject: Merge tag 'libnvdimm-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdim... X-Git-Tag: v5.15-rc1~45 X-Git-Url: http://git.samba.org/samba.git/?p=sfrench%2Fcifs-2.6.git;a=commitdiff_plain;h=2e5fd489a4e5fcc97b035c03ace724c1d481a4c1 Merge tag 'libnvdimm-for-5.15' of git://git./linux/kernel/git/nvdimm/nvdimm Pull libnvdimm updates from Dan Williams: - Fix a race condition in the teardown path of raw mode pmem namespaces. - Cleanup the code that filesystems use to detect filesystem-dax capabilities of their underlying block device. * tag 'libnvdimm-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: dax: remove bdev_dax_supported xfs: factor out a xfs_buftarg_is_dax helper dax: stub out dax_supported for !CONFIG_FS_DAX dax: remove __generic_fsdax_supported dax: move the dax_read_lock() locking into dax_supported dax: mark dax_get_by_host static dm: use fs_dax_get_by_bdev instead of dax_get_by_host dax: stop using bdevname fsdax: improve the FS_DAX Kconfig description and help text libnvdimm/pmem: Fix crash triggered when I/O in-flight during unbind --- 2e5fd489a4e5fcc97b035c03ace724c1d481a4c1 diff --cc fs/erofs/super.c index a8d49e8fc83a,8fc6c04b54f4..11b88559f8bf --- a/fs/erofs/super.c +++ b/fs/erofs/super.c @@@ -545,11 -500,6 +545,11 @@@ static int erofs_fc_fill_super(struct s if (err) return err; + if (test_opt(ctx, DAX_ALWAYS) && - !bdev_dax_supported(sb->s_bdev, EROFS_BLKSIZ)) { ++ !dax_supported(sbi->dax_dev, sb->s_bdev, EROFS_BLKSIZ, 0, bdev_nr_sectors(sb->s_bdev))) { + errorfc(fc, "DAX unsupported by block device. Turning off DAX."); + clear_opt(ctx, DAX_ALWAYS); + } sb->s_flags |= SB_RDONLY | SB_NOATIME; sb->s_maxbytes = MAX_LFS_FILESIZE; sb->s_time_gran = 1; diff --cc fs/xfs/xfs_super.c index 9a86d3ec2cb6,f4384974e52a..c4e0cd1c1c8c --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@@ -327,9 -311,18 +327,18 @@@ xfs_set_inode_alloc xfs_perag_put(pag); } - return (mp->m_flags & XFS_MOUNT_32BITINODES) ? maxagi : agcount; + return xfs_is_inode32(mp) ? maxagi : agcount; } + static bool + xfs_buftarg_is_dax( + struct super_block *sb, + struct xfs_buftarg *bt) + { + return dax_supported(bt->bt_daxdev, bt->bt_bdev, sb->s_blocksize, 0, + bdev_nr_sectors(bt->bt_bdev)); + } + STATIC int xfs_blkdev_get( xfs_mount_t *mp,