diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2018-07-14 21:06:51 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:07 -0400 |
commit | 88c07f739786d00c7526d598956955c8310d72d2 (patch) | |
tree | 9f34060d43a1588532ff962cdf4c0d68d1a6110c /fs/bcachefs/recovery.c | |
parent | 1c6fdbd8f2465ddfb73a01ec620cbf3d14044e1a (diff) | |
download | lwn-88c07f739786d00c7526d598956955c8310d72d2.tar.gz lwn-88c07f739786d00c7526d598956955c8310d72d2.zip |
bcachefs: Only check inode i_nlink during full fsck
Now that all filesystem operatinos that manipulate the filesystem
heirachy and i_nlink are fully atomic, we can add a feature bit to
indicate i_nlink doesn't need to be checked.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/recovery.c')
-rw-r--r-- | fs/bcachefs/recovery.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c index 2596c3c26064..624d97dc4537 100644 --- a/fs/bcachefs/recovery.c +++ b/fs/bcachefs/recovery.c @@ -256,6 +256,12 @@ int bch2_fs_recovery(struct bch_fs *c) if (ret) goto err; + if (!test_bit(BCH_FS_FSCK_UNFIXED_ERRORS, &c->flags)) { + mutex_lock(&c->sb_lock); + c->disk_sb.sb->features[0] |= 1ULL << BCH_FEATURE_ATOMIC_NLINK; + mutex_unlock(&c->sb_lock); + } + if (enabled_qtypes(c)) { bch_verbose(c, "reading quotas:"); ret = bch2_fs_quota_read(c); @@ -366,6 +372,7 @@ int bch2_fs_initialize(struct bch_fs *c) mutex_lock(&c->sb_lock); SET_BCH_SB_INITIALIZED(c->disk_sb.sb, true); SET_BCH_SB_CLEAN(c->disk_sb.sb, false); + c->disk_sb.sb->features[0] |= 1ULL << BCH_FEATURE_ATOMIC_NLINK; bch2_write_super(c); mutex_unlock(&c->sb_lock); |