All of
 help / color / mirror / Atom feed
From: Sage Weil <>
Cc: Sage Weil <>
Subject: [PATCH] Btrfs: fail mount on bad mount options
Date: Fri,  6 Nov 2009 22:19:16 -0800	[thread overview]
Message-ID: <> (raw)

We shouldn't silently ignore unrecognized options.

Signed-off-by: Sage Weil <>
 fs/btrfs/super.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

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);
+		case Opt_err:
+			printk(KERN_INFO "btrfs: unrecognized mount option "
+			       "'%s'\n", p);
+			ret = -EINVAL;
+			goto out;
-	return 0;
+	return ret;

                 reply	other threads:[~2009-11-07  6:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.