Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

btrfs: enable shutdown ioctl for non-experimental builds

Although commit 304076527c38 ("btrfs: move shutdown and remove_bdev
callbacks out of experimental features") tries to move both shutdown and
remove_bdev out of experimental features, that commit has only addressed
the super block operation callback, the ioctl one is left untouched.

Fix that missing aspect by also moving shutdown ioctl out of
experimental features.

Since we're here, also add unknown flag detection to reject any
unsupported shutdown flags.

Fixes: 304076527c38 ("btrfs: move shutdown and remove_bdev callbacks out of experimental features")
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>

authored by

Qu Wenruo and committed by
David Sterba
41e706c0 a86a2834

+3 -4
+3 -4
fs/btrfs/ioctl.c
··· 5102 5102 return 0; 5103 5103 } 5104 5104 5105 - #ifdef CONFIG_BTRFS_EXPERIMENTAL 5106 5105 static int btrfs_ioctl_shutdown(struct btrfs_fs_info *fs_info, unsigned long arg) 5107 5106 { 5108 5107 int ret = 0; ··· 5133 5134 case BTRFS_SHUTDOWN_FLAGS_NOLOGFLUSH: 5134 5135 btrfs_force_shutdown(fs_info); 5135 5136 break; 5137 + default: 5138 + ret = -EINVAL; 5139 + break; 5136 5140 } 5137 5141 return ret; 5138 5142 } 5139 - #endif 5140 5143 5141 5144 long btrfs_ioctl(struct file *file, unsigned int 5142 5145 cmd, unsigned long arg) ··· 5295 5294 #endif 5296 5295 case BTRFS_IOC_SUBVOL_SYNC_WAIT: 5297 5296 return btrfs_ioctl_subvol_sync(fs_info, argp); 5298 - #ifdef CONFIG_BTRFS_EXPERIMENTAL 5299 5297 case BTRFS_IOC_SHUTDOWN: 5300 5298 return btrfs_ioctl_shutdown(fs_info, arg); 5301 - #endif 5302 5299 } 5303 5300 5304 5301 return -ENOTTY;