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.

xfs: stop using set_blocksize

XFS has its own buffer cache for metadata that uses submit_bio, which
means that it no longer uses the block device pagecache for anything.
Create a more lightweight helper that runs the blocksize checks and
flushes dirty data and use that instead. No more truncating the
pagecache because XFS does not use it or care about it.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>

authored by

Darrick J. Wong and committed by
Carlos Maiolino
5088aad3 d0d7f181

+11 -4
+11 -4
fs/xfs/xfs_buf.c
··· 1719 1719 struct xfs_buftarg *btp, 1720 1720 unsigned int sectorsize) 1721 1721 { 1722 + int error; 1723 + 1722 1724 /* Set up metadata sector size info */ 1723 1725 btp->bt_meta_sectorsize = sectorsize; 1724 1726 btp->bt_meta_sectormask = sectorsize - 1; 1725 1727 1726 - if (set_blocksize(btp->bt_bdev_file, sectorsize)) { 1728 + error = bdev_validate_blocksize(btp->bt_bdev, sectorsize); 1729 + if (error) { 1727 1730 xfs_warn(btp->bt_mount, 1728 - "Cannot set_blocksize to %u on device %pg", 1729 - sectorsize, btp->bt_bdev); 1731 + "Cannot use blocksize %u on device %pg, err %d", 1732 + sectorsize, btp->bt_bdev, error); 1730 1733 return -EINVAL; 1731 1734 } 1732 1735 1733 - return 0; 1736 + /* 1737 + * Flush the block device pagecache so our bios see anything dirtied 1738 + * before mount. 1739 + */ 1740 + return sync_blockdev(btp->bt_bdev); 1734 1741 } 1735 1742 1736 1743 int