Btrfs: fail mount on bad mount options
diff mbox

Message ID 1257574756-13333-1-git-send-email-sage@newdream.net
State Accepted
Headers show

Commit Message

Sage Weil Nov. 7, 2009, 6:19 a.m. UTC
None

Patch
diff mbox

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index ad4d378..73adcef 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -129,6 +129,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;
@@ -268,12 +269,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;
 }
 
 /*