Skip to contentSkip to conversation

bcachefs: reject unknown mount options

PATCH Superseded David Disseldorp 2 participants 2 messages Sep 6, 2024

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 bcachefs: reject unknown mount options

This is effectively a revert of commit 03ef80b469d5 ("bcachefs: Ignore unknown mount options"), rebased atop commit 929d954330142 ("bcachefs:
use new mount API").

Contrary to the 03ef80b469d5 commit message, unknown mount options do result in failure on other filesystems such as xfs, btrfs, ext4, etc.

Ignoring unknown options may result in unexpected behaviour: e.g. if an application requires future-workload-specific-mount-option to work and is run on a system without future-workload-specific-mount-option kernel support, then it may fail without indication of the missing kernel functionality.

This reversion may cause failures for existing users reliant on the ignore-unknown behaviour, but it should be bearable given bcachefs is still flagged experimental.

Fixes 03ef80b469d5 ("bcachefs: Ignore unknown mount options")

---
Changes since v1:
- reword commit message and add Fixes tag

 fs/bcachefs/opts.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/bcachefs/opts.c +1 -2
index e10fc1da71b1..bc5c18087821 100644
@@ -482,9 +482,8 @@ int bch2_parse_one_mount_opt(struct bch_fs *c, struct bch_opts *opts,
 		val = "0";
 	}
 
-	/* Unknown options are ignored: */
 	if (id < 0)
-		return 0;
+		goto bad_opt;
 
 	if (!(bch2_opt_table[id].flags & OPT_MOUNT))
 		goto bad_opt;
Signature · 1 line
2.43.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 33 lines · David Disseldorp

This is effectively a revert of commit 03ef80b469d5 ("bcachefs: Ignore unknown mount options"), rebased atop commit 929d954330142 ("bcachefs:
use new mount API").

Contrary to the 03ef80b469d5 commit message, unknown mount options do result in failure on other filesystems such as xfs, btrfs, ext4, etc.

Ignoring unknown options may result in unexpected behaviour: e.g. if an application requires future-workload-specific-mount-option to work and is run on a system without future-workload-specific-mount-option kernel support, then it may fail without indication of the missing kernel functionality.

This reversion may cause failures for existing users reliant on the ignore-unknown behaviour, but it should be bearable given bcachefs is still flagged experimental.

Fixes 03ef80b469d5 ("bcachefs: Ignore unknown mount options")

---
Changes since v1:
- reword commit message and add Fixes tag

  fs/bcachefs/opts.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
fs/bcachefs/opts.c +0 -0
index e10fc1da71b1..bc5c18087821 100644

fs/bcachefs/opts.c int bch2_parse_one_mount_opt(struct bch_fs *c, struct bch_opts *opts, · line 486

Quoted 7 lines
fs/bcachefs/opts.c +1 -2
@@ -482,9 +482,8 @@ int bch2_parse_one_mount_opt(struct bch_fs *c, struct bch_opts *opts,
  		val = "0";
  	}
 
-	/* Unknown options are ignored: */
  	if (id < 0)
-		return 0;
+		goto bad_opt;
Quoted 3 lines
fs/bcachefs/opts.c +0 -0
  	if (!(bch2_opt_table[id].flags & OPT_MOUNT))
  		goto bad_opt;