Skip to content

Commit ac6ea6a

Browse files
asjkdave
authored andcommitted
btrfs: disable the device add feature for temp-fsid
The device addition operation will transform the cloned temp-fsid mounted device into a multi-device filesystem. Therefore, it is marked as unsupported. Signed-off-by: Anand Jain <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent c47b02c commit ac6ea6a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

fs/btrfs/ioctl.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2635,6 +2635,12 @@ static long btrfs_ioctl_add_dev(struct btrfs_fs_info *fs_info, void __user *arg)
26352635
return -EINVAL;
26362636
}
26372637

2638+
if (fs_info->fs_devices->temp_fsid) {
2639+
btrfs_err(fs_info,
2640+
"device add not supported on cloned temp-fsid mount");
2641+
return -EINVAL;
2642+
}
2643+
26382644
if (!btrfs_exclop_start(fs_info, BTRFS_EXCLOP_DEV_ADD)) {
26392645
if (!btrfs_exclop_start_try_lock(fs_info, BTRFS_EXCLOP_DEV_ADD))
26402646
return BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS;

0 commit comments

Comments
 (0)