diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2019-03-21 22:19:57 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:18 -0400 |
commit | 134915f3d38d830374603b84a9fe2e280f4814ed (patch) | |
tree | 5c7c2ad3fab6863e048c6d9de098bdb7fefa77dc /fs/bcachefs/fs.c | |
parent | 65e7ab8f2aa7d45190f1e90b1332c71ef83587a6 (diff) | |
download | lwn-134915f3d38d830374603b84a9fe2e280f4814ed.tar.gz lwn-134915f3d38d830374603b84a9fe2e280f4814ed.zip |
bcachefs: Go rw lazily
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/fs.c')
-rw-r--r-- | fs/bcachefs/fs.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c index dc55d36ecfd5..2f01d97470b1 100644 --- a/fs/bcachefs/fs.c +++ b/fs/bcachefs/fs.c @@ -1616,7 +1616,7 @@ static struct bch_fs *__bch2_open_as_blockdevs(const char *dev_name, char * cons mutex_lock(&c->state_lock); - if (!bch2_fs_running(c)) { + if (!test_bit(BCH_FS_STARTED, &c->flags)) { mutex_unlock(&c->state_lock); closure_put(&c->cl); pr_err("err mounting %s: incomplete filesystem", dev_name); @@ -1672,8 +1672,6 @@ static int bch2_remount(struct super_block *sb, int *flags, char *data) return ret; if (opts.read_only != c->opts.read_only) { - const char *err = NULL; - mutex_lock(&c->state_lock); if (opts.read_only) { @@ -1681,9 +1679,9 @@ static int bch2_remount(struct super_block *sb, int *flags, char *data) sb->s_flags |= SB_RDONLY; } else { - err = bch2_fs_read_write(c); - if (err) { - bch_err(c, "error going rw: %s", err); + ret = bch2_fs_read_write(c); + if (ret) { + bch_err(c, "error going rw: %i", ret); return -EINVAL; } |