]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
zonefs: use ZONEFS_SUPER_SIZE instead of PAGE_SIZE
authorJohannes Thumshirn <johannes.thumshirn@wdc.com>
Tue, 29 Apr 2025 13:42:53 +0000 (15:42 +0200)
committerDamien Le Moal <dlemoal@kernel.org>
Fri, 13 Jun 2025 06:49:00 +0000 (15:49 +0900)
Use ZONEFS_SUPER_SIZE constant instead of PAGE_SIZE allocating memory for
reading the super block in zonefs_read_super().

While PAGE_SIZE technically isn't incorrect as Linux doesn't support pages
smaller than 4k ZONEFS_SUPER_SIZE is semantically more correct.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
fs/zonefs/super.c

index d165eb979f21a134c25be7615438960acbf028e2..4dc7f967c861b37d51b936cee0772e043c0bc891 100644 (file)
@@ -1113,11 +1113,12 @@ static int zonefs_read_super(struct super_block *sb)
        u32 crc, stored_crc;
        int ret;
 
-       super = kmalloc(PAGE_SIZE, GFP_KERNEL);
+       super = kmalloc(ZONEFS_SUPER_SIZE, GFP_KERNEL);
        if (!super)
                return -ENOMEM;
 
-       ret = bdev_rw_virt(sb->s_bdev, 0, super, PAGE_SIZE, REQ_OP_READ);
+       ret = bdev_rw_virt(sb->s_bdev, 0, super, ZONEFS_SUPER_SIZE,
+                          REQ_OP_READ);
        if (ret)
                goto free_super;