Btrfs: fail mount on bad mount options
[linux-2.6-block.git] / fs / btrfs / super.c
index 752a5463bf53aee147068c2a0a9f678e12250f38..193d920e54eb3d80e5c2942833bca1ec635ef593 100644 (file)
@@ -128,6 +128,7 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
        substring_t args[MAX_OPT_ARGS];
        char *p, *num;
        int intarg;
+       int ret = 0;
 
        if (!options)
                return 0;
@@ -262,12 +263,18 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
                case Opt_discard:
                        btrfs_set_opt(info->mount_opt, DISCARD);
                        break;
+               case Opt_err:
+                       printk(KERN_INFO "btrfs: unrecognized mount option "
+                              "'%s'\n", p);
+                       ret = -EINVAL;
+                       goto out;
                default:
                        break;
                }
        }
+out:
        kfree(options);
-       return 0;
+       return ret;
 }
 
 /*
@@ -405,8 +412,8 @@ int btrfs_sync_fs(struct super_block *sb, int wait)
                return 0;
        }
 
-       btrfs_start_delalloc_inodes(root);
-       btrfs_wait_ordered_extents(root, 0);
+       btrfs_start_delalloc_inodes(root, 0);
+       btrfs_wait_ordered_extents(root, 0, 0);
 
        trans = btrfs_start_transaction(root, 1);
        ret = btrfs_commit_transaction(trans, root);