On 04.07.25 01:43, Qu Wenruo wrote: > long btrfs_ioctl(struct file *file, unsigned int > cmd, unsigned long arg) > { > @@ -5201,6 +5231,8 @@ long btrfs_ioctl(struct file *file, unsigned int > struct btrfs_fs_info *fs_info = inode_to_fs_info(inode); > struct btrfs_root *root = BTRFS_I(inode)->root; > void __user *argp = (void __user *)arg; > + /* If @arg is just an unsigned long value. */ > + unsigned long flags; > > switch (cmd) { > case FS_IOC_GETVERSION: > @@ -5349,6 +5381,14 @@ long btrfs_ioctl(struct file *file, unsigned int > #endif > case BTRFS_IOC_SUBVOL_SYNC_WAIT: > return btrfs_ioctl_subvol_sync(fs_info, argp); > +#ifdef CONFIG_BTRFS_EXPERIMENTAL > + case BTRFS_IOC_SHUTDOWN: > + if (!capable(CAP_SYS_ADMIN)) > + return -EPERM; > + if (get_user(flags, (__u32 __user *)arg)) > + return -EFAULT; > + return btrfs_emergency_shutdown(fs_info, flags); > +#endif With that you'll get buildbot complaints if CONFIG_BTRFS_EXPERIMENTAL=n because flags is unused. I'd probably put the get_user(flags, ...) into btrfs_emergency_shutdown() to silence the compiler.