diff options
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r-- | fs/btrfs/super.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index db9fb3bc1e33..19a4daf03ccb 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -37,7 +37,6 @@ | |||
37 | #include <linux/ctype.h> | 37 | #include <linux/ctype.h> |
38 | #include <linux/namei.h> | 38 | #include <linux/namei.h> |
39 | #include <linux/miscdevice.h> | 39 | #include <linux/miscdevice.h> |
40 | #include <linux/version.h> | ||
41 | #include <linux/magic.h> | 40 | #include <linux/magic.h> |
42 | #include "compat.h" | 41 | #include "compat.h" |
43 | #include "ctree.h" | 42 | #include "ctree.h" |
@@ -380,7 +379,6 @@ int btrfs_sync_fs(struct super_block *sb, int wait) | |||
380 | btrfs_start_delalloc_inodes(root); | 379 | btrfs_start_delalloc_inodes(root); |
381 | btrfs_wait_ordered_extents(root, 0); | 380 | btrfs_wait_ordered_extents(root, 0); |
382 | 381 | ||
383 | btrfs_clean_old_snapshots(root); | ||
384 | trans = btrfs_start_transaction(root, 1); | 382 | trans = btrfs_start_transaction(root, 1); |
385 | ret = btrfs_commit_transaction(trans, root); | 383 | ret = btrfs_commit_transaction(trans, root); |
386 | sb->s_dirt = 0; | 384 | sb->s_dirt = 0; |
@@ -512,6 +510,10 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data) | |||
512 | struct btrfs_root *root = btrfs_sb(sb); | 510 | struct btrfs_root *root = btrfs_sb(sb); |
513 | int ret; | 511 | int ret; |
514 | 512 | ||
513 | ret = btrfs_parse_options(root, data); | ||
514 | if (ret) | ||
515 | return -EINVAL; | ||
516 | |||
515 | if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY)) | 517 | if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY)) |
516 | return 0; | 518 | return 0; |
517 | 519 | ||
@@ -583,17 +585,18 @@ static long btrfs_control_ioctl(struct file *file, unsigned int cmd, | |||
583 | struct btrfs_ioctl_vol_args *vol; | 585 | struct btrfs_ioctl_vol_args *vol; |
584 | struct btrfs_fs_devices *fs_devices; | 586 | struct btrfs_fs_devices *fs_devices; |
585 | int ret = -ENOTTY; | 587 | int ret = -ENOTTY; |
586 | int len; | ||
587 | 588 | ||
588 | if (!capable(CAP_SYS_ADMIN)) | 589 | if (!capable(CAP_SYS_ADMIN)) |
589 | return -EPERM; | 590 | return -EPERM; |
590 | 591 | ||
591 | vol = kmalloc(sizeof(*vol), GFP_KERNEL); | 592 | vol = kmalloc(sizeof(*vol), GFP_KERNEL); |
593 | if (!vol) | ||
594 | return -ENOMEM; | ||
595 | |||
592 | if (copy_from_user(vol, (void __user *)arg, sizeof(*vol))) { | 596 | if (copy_from_user(vol, (void __user *)arg, sizeof(*vol))) { |
593 | ret = -EFAULT; | 597 | ret = -EFAULT; |
594 | goto out; | 598 | goto out; |
595 | } | 599 | } |
596 | len = strnlen(vol->name, BTRFS_PATH_NAME_MAX); | ||
597 | 600 | ||
598 | switch (cmd) { | 601 | switch (cmd) { |
599 | case BTRFS_IOC_SCAN_DEV: | 602 | case BTRFS_IOC_SCAN_DEV: |