On 2024/9/22 7:13, Kent Overstreet wrote:
On Tue, Sep 17, 2024 at 01:39:57AM GMT, David Disseldorp wrote:
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")
Reported-by: Martin Doucha <[email protected]>
Closes: https://bugzilla.opensuse.org/show_bug.cgi?id=1230065
Signed-off-by: David Disseldorp <[email protected]>
Reviewed-by: Hongbo Li <[email protected]>
I applied this and got some new failures in the CI - it seems something
is broken in remount.
00162 ========= TEST ec_small
00162
00162 WATCHDOG 60
00163 bcachefs (857683e6-ef4f-41f5-abdd-dca191c38fff): starting version 1.12:
rebalance_work_acct_fix
opts=errors=panic,metadata_replicas=2,data_replicas=2,erasure_code
00163 bcachefs (857683e6-ef4f-41f5-abdd-dca191c38fff): initializing new
filesystem
00163 bcachefs (857683e6-ef4f-41f5-abdd-dca191c38fff): going read-write
00163 bcachefs (857683e6-ef4f-41f5-abdd-dca191c38fff): marking superblocks
00163 bcachefs (857683e6-ef4f-41f5-abdd-dca191c38fff): initializing freespace
00163 bcachefs (857683e6-ef4f-41f5-abdd-dca191c38fff): done initializing
freespace
00163 bcachefs (857683e6-ef4f-41f5-abdd-dca191c38fff): reading snapshots table
00163 bcachefs (857683e6-ef4f-41f5-abdd-dca191c38fff): reading snapshots done
00163 bcachefs (857683e6-ef4f-41f5-abdd-dca191c38fff): done starting filesystem
00163 1+0 records in
00163 1+0 records out
00163 1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.0115145 s, 91.1 MB/s
00163 bcachefs: bch2_parse_one_mount_opt() Bad mount option rwerrors
00163 Error: Invalid argument
00163 Error 1 at /host//home/testdashboard/ktest/tests/fs/bcachefs/ec.ktest 32
from: mount -o remount,ro /mnt, exiting
00163 Error 1 at /host/home/testdashboard/ktest/tests/prelude.sh 269 from: (
set -e; run_test $i ), exiting
00163
00163 ========= FAILED ec_small in 2s
The test is just doing
mount -o remount,ro /mnt
ah, this is indeed a bug in show_options. It misses a comma when fill
options buffer to seq. The following code should be added.
diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c
index e774cb3e6b1a..79c3a650b714 100644
--- a/fs/bcachefs/fs.c
+++ b/fs/bcachefs/fs.c
@@ -1927,7 +1927,7 @@ static int bch2_show_options(struct seq_file *seq,
struct dentry *root)
bch2_opts_to_text(&buf, c->opts, c, c->disk_sb.sb,
OPT_MOUNT, OPT_HIDDEN, OPT_SHOW_MOUNT_STYLE);
printbuf_nul_terminate(&buf);
- seq_puts(seq, buf.buf);
+ seq_printf(seq, ",%s", buf.buf);
int ret = buf.allocation_failure ? -ENOMEM : 0;
printbuf_exit(&buf);
I will send this later. The test passed in my environment with this v2
patch.
Thanks,
Hongbo
Thomas, this is likely something you introduced, think you could take a
look?