summaryrefslogtreecommitdiff
path: root/fs/btrfs
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-10-02 14:44:15 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-10-02 14:44:15 +0300
commit2844b98acb6112cf1eb7a16bbdc7fe9b319c17d4 (patch)
treedca5ec4aeb4edeb0cbe0e04a4b24f7cc91f7a2e1 /fs/btrfs
parent56fb05093756ed55ba1cdf5d432a68004da67860 (diff)
parent72b82d56b82137a92a20e5584029d35408d810c2 (diff)
downloadlinux-rolling-lts.tar.xz
Merge v6.12.50linux-rolling-lts
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/volumes.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 58e0cac5779d..ce991a839046 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -2699,6 +2699,11 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *device_path
goto error;
}
+ if (bdev_nr_bytes(file_bdev(bdev_file)) <= BTRFS_DEVICE_RANGE_RESERVED) {
+ ret = -EINVAL;
+ goto error;
+ }
+
if (fs_devices->seeding) {
seeding_dev = true;
down_write(&sb->s_umount);