diff options
author | 2021-03-21 16:03:23 -0400 | |
---|---|---|
committer | 2023-10-22 17:08:56 -0400 | |
commit | 84cc758d6b19ae8a92389306fe3510e58a08d90c (patch) | |
tree | ea89ae207a21ab7bfba24a28b88c3722e2b8dea3 /fs/bcachefs/super-io.c | |
parent | bcachefs: Don't overwrite snapshot field in bch2_cut_back() (diff) | |
download | linux-84cc758d6b19ae8a92389306fe3510e58a08d90c.tar.gz linux-84cc758d6b19ae8a92389306fe3510e58a08d90c.tar.bz2 linux-84cc758d6b19ae8a92389306fe3510e58a08d90c.zip |
bcachefs: Validate bset version field against sb version fields
The superblock version fields need to be accurate to know whether a
filesystem is supported, thus we should be verifying them.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
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 | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/bcachefs/super-io.c b/fs/bcachefs/super-io.c index 6e61cf5ab217..e397a2a70c9c 100644 --- a/fs/bcachefs/super-io.c +++ b/fs/bcachefs/super-io.c @@ -369,6 +369,7 @@ static void bch2_sb_update(struct bch_fs *c) c->sb.uuid = src->uuid; c->sb.user_uuid = src->user_uuid; c->sb.version = le16_to_cpu(src->version); + c->sb.version_min = le16_to_cpu(src->version_min); c->sb.nr_devices = src->nr_devices; c->sb.clean = BCH_SB_CLEAN(src); c->sb.encryption_type = BCH_SB_ENCRYPTION_TYPE(src); |