From: Jan Kara Date: Wed, 1 Nov 2023 17:43:11 +0000 (+0100) Subject: xfs: Block writes to log device X-Git-Tag: v6.8-rc1~214^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3584c8f48a70c1f74c7b7bab59cf22bb66224649;p=thirdparty%2Flinux.git xfs: Block writes to log device Ask block layer to not allow other writers to open block devices used for xfs log and realtime devices. Reviewed-by: Darrick J. Wong Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20231101174325.10596-6-jack@suse.cz Reviewed-by: Jens Axboe Signed-off-by: Christian Brauner --- diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 86e94654a92b5..07857d967ee8b 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -366,8 +366,9 @@ xfs_blkdev_get( { int error = 0; - *handlep = bdev_open_by_path(name, BLK_OPEN_READ | BLK_OPEN_WRITE, - mp->m_super, &fs_holder_ops); + *handlep = bdev_open_by_path(name, + BLK_OPEN_READ | BLK_OPEN_WRITE | BLK_OPEN_RESTRICT_WRITES, + mp->m_super, &fs_holder_ops); if (IS_ERR(*handlep)) { error = PTR_ERR(*handlep); *handlep = NULL;