mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 14:56:54 -04:00
bcachefs: disallow ever going rw if nochanges or noreplay
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
committed by
Kent Overstreet
parent
4881fdb756
commit
330581f16f
@@ -378,6 +378,10 @@ int __bch2_fs_read_write(struct bch_fs *c, bool early)
|
||||
if (test_bit(BCH_FS_RW, &c->flags))
|
||||
return 0;
|
||||
|
||||
if (c->opts.nochanges ||
|
||||
c->opts.noreplay)
|
||||
return -EINVAL;
|
||||
|
||||
ret = bch2_fs_mark_dirty(c);
|
||||
if (ret)
|
||||
goto err;
|
||||
@@ -684,6 +688,7 @@ static struct bch_fs *bch2_fs_alloc(struct bch_sb *sb, struct bch_opts opts)
|
||||
|
||||
c->opts.nochanges |= c->opts.noreplay;
|
||||
c->opts.read_only |= c->opts.nochanges;
|
||||
c->opts.read_only |= c->opts.noreplay;
|
||||
|
||||
if (bch2_fs_init_fault("fs_alloc"))
|
||||
goto err;
|
||||
|
||||
Reference in New Issue
Block a user