]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
bcachefs: Remove BCACHEFS_SB_MAX_SIZE & check
authorTony Asleson <tasleson@redhat.com>
Mon, 29 Apr 2024 18:04:12 +0000 (13:04 -0500)
committerTony Asleson <tasleson@redhat.com>
Tue, 30 Apr 2024 18:45:15 +0000 (13:45 -0500)
This constant had an incorrect value.  However, the code already
does a max. size check which is correct.

Note: bcachefs can theoretically have a superblock of 32MiB, but
this is very unlikely to happen.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
libblkid/src/superblocks/bcache.c

index 47d906063db4d2e860556b95a5efa5e760641411..8ad2dc0f874e6607bad3ee34c349605edb76804c 100644 (file)
@@ -164,8 +164,6 @@ struct bcachefs_super_block {
 #define BCACHEFS_SECTOR_SIZE   512U
 /* maximum superblock size shift */
 #define BCACHEFS_SB_MAX_SIZE_SHIFT   0x10U
-/* maximum superblock size */
-#define BCACHEFS_SB_MAX_SIZE   (1U << BCACHEFS_SB_MAX_SIZE_SHIFT)
 /* fields offset within super block */
 #define BCACHEFS_SB_FIELDS_OFF offsetof(struct bcachefs_super_block, _start)
 /* tag value for members field */
@@ -360,9 +358,6 @@ static int probe_bcachefs(blkid_probe pr, const struct blkid_idmag *mag)
 
        sb_size = BCACHEFS_SB_FIELDS_OFF + BYTES(bcs);
 
-       if (sb_size > BCACHEFS_SB_MAX_SIZE)
-               return BLKID_PROBE_NONE;
-
        if (bcs->layout.sb_max_size_bits > BCACHEFS_SB_MAX_SIZE_SHIFT)
                return BLKID_PROBE_NONE;