]> git.itanic.dy.fi Git - linux-stable/commitdiff
xfs: Block writes to log device
authorJan Kara <jack@suse.cz>
Wed, 1 Nov 2023 17:43:11 +0000 (18:43 +0100)
committerChristian Brauner <brauner@kernel.org>
Sat, 18 Nov 2023 13:59:25 +0000 (14:59 +0100)
Ask block layer to not allow other writers to open block devices used
for xfs log and realtime devices.

Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20231101174325.10596-6-jack@suse.cz
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/xfs/xfs_super.c

index 86e94654a92b5e2cb87643e1dff6ab1759eb139b..07857d967ee8b528bab444f016a8cbd19bd6446c 100644 (file)
@@ -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;