lkml.org 
[lkml]   [2010]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[056/111] Btrfs: fail mount on bad mount options
2.6.32-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Sage Weil <sage@newdream.net>

commit a7a3f7cadd9bdee569243f7ead9550aa16b60e07 upstream.

We shouldn't silently ignore unrecognized options.

Signed-off-by: Sage Weil <sage@newdream.net>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Acked-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
fs/btrfs/super.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -128,6 +128,7 @@ int btrfs_parse_options(struct btrfs_roo
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_roo
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;
}

/*



\
 
 \ /
  Last update: 2010-08-12 02:39    [W:0.397 / U:2.668 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site