Skip to contentSkip to conversation

Revert "bcachefs: Ignore unknown mount options"

PATCH In review David Disseldorp 2 participants 4 messages Sep 5, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "bcachefs: Ignore unknown mount options"

This reverts commit 03ef80b469d5d83530ce1ce15be78a40e5300f9b.

Contrary to the 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.

---
 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
#1 lore raw
Quoted 2 lines · David Disseldorp

This reverts commit 03ef80b469d5d83530ce1ce15be78a40e5300f9b.

May be the subject should be Fix .... The original commit 03ef80b469d5d83530ce1ce15be78a40e5300f9b has been changed by other change.

Quoted 25 lines

Contrary to the 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.

---
  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;

As other filesystem done, for unknown options, it prints the Unknown parameter to hint the user. May be goto bad_opt is not reasonable.

Thanks,
Hongbo

Quoted 3 lines
fs/bcachefs/opts.c +0 -0
  	if (!(bch2_opt_table[id].flags & OPT_MOUNT))
  		goto bad_opt;
#2 lore raw
Quoted 5 lines · Hongbo Li
Quoted 2 lines · David Disseldorp

This reverts commit 03ef80b469d5d83530ce1ce15be78a40e5300f9b.

May be the subject should be Fix .... The original commit 03ef80b469d5d83530ce1ce15be78a40e5300f9b has been changed by other change.

True, it's not a clean revert of 03ef80b469d5d ("bcachefs: Ignore unknown mount options") but is atop 929d954330142 ("bcachefs: use new mount API"). Can change this over to a regular Fixes commit if desired.

Quoted 28 lines
Quoted 28 lines

Contrary to the 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.

---
  fs/bcachefs/opts.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
fs/bcachefs/opts.c +0 -0
index e10fc1da71b1..bc5c18087821 100644
@@ -482,9 +482,8 @@ int bch2_parse_one_mount_opt(struct bch_fs *c, struct bch_opts *opts,
  		val = "0";
  	}
 
Quoted 6 lines

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

Quoted 4 lines
fs/bcachefs/opts.c +1 -2
-	/* Unknown options are ignored: */
  	if (id < 0)
-		return 0;
+		goto bad_opt;  

As other filesystem done, for unknown options, it prints the Unknown parameter to hint the user. May be goto bad_opt is not reasonable.

bad_opt prints an error message naming the invalid option:
521 bad_opt:

522         pr_err("Bad mount option %s", name);
523         ret = -BCH_ERR_option_name;
524         goto out;

Thanks, David

#3 lore raw
Quoted 12 lines · David Disseldorp
Quoted 5 lines · Hongbo Li
Quoted 2 lines · David Disseldorp

This reverts commit 03ef80b469d5d83530ce1ce15be78a40e5300f9b.

May be the subject should be Fix .... The original commit 03ef80b469d5d83530ce1ce15be78a40e5300f9b has been changed by other change.

True, it's not a clean revert of 03ef80b469d5d ("bcachefs: Ignore unknown mount options") but is atop 929d954330142 ("bcachefs: use new mount API"). Can change this over to a regular Fixes commit if desired.

In my humble opinion, fixes commit seems better. And also add Fixes: 03ef80b469d5 ("bcachefs: Ignore unknown mount options").

Quoted 28 lines
Quoted 28 lines
Quoted 28 lines

Contrary to the 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.

---
   fs/bcachefs/opts.c | 3 +--
   1 file changed, 1 insertion(+), 2 deletions(-)
fs/bcachefs/opts.c +0 -0
index e10fc1da71b1..bc5c18087821 100644
@@ -482,9 +482,8 @@ int bch2_parse_one_mount_opt(struct bch_fs *c, struct bch_opts *opts,
   		val = "0";
   	}
 
Quoted 8 lines
Quoted 6 lines

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

Quoted 4 lines
fs/bcachefs/opts.c +1 -2
-	/* Unknown options are ignored: */
   	if (id < 0)
-		return 0;
+		goto bad_opt;

As other filesystem done, for unknown options, it prints the Unknown parameter to hint the user. May be goto bad_opt is not reasonable.

bad_opt prints an error message naming the invalid option:

ok, it seems good.

Thanks,
Hongbo

Quoted 6 lines

521 bad_opt:

522         pr_err("Bad mount option %s", name);
523         ret = -BCH_ERR_option_name;
524         goto out;

Thanks, David