diff options
| author | Kent Overstreet <kent.overstreet@linux.dev> | 2025-02-28 18:59:58 -0500 |
|---|---|---|
| committer | Kent Overstreet <kent.overstreet@linux.dev> | 2025-03-14 21:02:15 -0400 |
| commit | 6422bf8117cc2a8922b908a2634c01f4a2cd1818 (patch) | |
| tree | bba347fe55f4b18746899088f9b22dbee249a17d /fs/bcachefs/super-io.c | |
| parent | bcachefs: Fix error type in bch2_alloc_v3_validate() (diff) | |
| download | linux-6422bf8117cc2a8922b908a2634c01f4a2cd1818.tar.gz linux-6422bf8117cc2a8922b908a2634c01f4a2cd1818.zip | |
bcachefs: bch2_request_incompat_feature() now returns error code
For future usage, we'll want a dedicated error code for better
debugging.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/super-io.c')
| -rw-r--r-- | fs/bcachefs/super-io.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/bcachefs/super-io.c b/fs/bcachefs/super-io.c index 7e726b3dc6f4..7bd2d3d84295 100644 --- a/fs/bcachefs/super-io.c +++ b/fs/bcachefs/super-io.c @@ -69,12 +69,14 @@ enum bcachefs_metadata_version bch2_latest_compatible_version(enum bcachefs_meta return v; } -bool bch2_set_version_incompat(struct bch_fs *c, enum bcachefs_metadata_version version) +int bch2_set_version_incompat(struct bch_fs *c, enum bcachefs_metadata_version version) { - bool ret = (c->sb.features & BIT_ULL(BCH_FEATURE_incompat_version_field)) && - version <= c->sb.version_incompat_allowed; + int ret = ((c->sb.features & BIT_ULL(BCH_FEATURE_incompat_version_field)) && + version <= c->sb.version_incompat_allowed) + ? 0 + : -BCH_ERR_may_not_use_incompat_feature; - if (ret) { + if (!ret) { mutex_lock(&c->sb_lock); SET_BCH_SB_VERSION_INCOMPAT(c->disk_sb.sb, max(BCH_SB_VERSION_INCOMPAT(c->disk_sb.sb), version)); |
