Skip to content

Commit 5088aad

Browse files
Darrick J. Wongcmaiolino
authored andcommitted
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>
1 parent d0d7f18 commit 5088aad

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

fs/xfs/xfs_buf.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1719,18 +1719,25 @@ xfs_setsize_buftarg(
17191719
struct xfs_buftarg *btp,
17201720
unsigned int sectorsize)
17211721
{
1722+
int error;
1723+
17221724
/* Set up metadata sector size info */
17231725
btp->bt_meta_sectorsize = sectorsize;
17241726
btp->bt_meta_sectormask = sectorsize - 1;
17251727

1726-
if (set_blocksize(btp->bt_bdev_file, sectorsize)) {
1728+
error = bdev_validate_blocksize(btp->bt_bdev, sectorsize);
1729+
if (error) {
17271730
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);
17301733
return -EINVAL;
17311734
}
17321735

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);
17341741
}
17351742

17361743
int

0 commit comments

Comments
 (0)