Skip to content

Commit 6982100

Browse files
morbidrsadamien-lemoal
authored andcommitted
zonefs: use ZONEFS_SUPER_SIZE instead of PAGE_SIZE
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>
1 parent 19272b3 commit 6982100

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

fs/zonefs/super.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,11 +1113,12 @@ static int zonefs_read_super(struct super_block *sb)
11131113
u32 crc, stored_crc;
11141114
int ret;
11151115

1116-
super = kmalloc(PAGE_SIZE, GFP_KERNEL);
1116+
super = kmalloc(ZONEFS_SUPER_SIZE, GFP_KERNEL);
11171117
if (!super)
11181118
return -ENOMEM;
11191119

1120-
ret = bdev_rw_virt(sb->s_bdev, 0, super, PAGE_SIZE, REQ_OP_READ);
1120+
ret = bdev_rw_virt(sb->s_bdev, 0, super, ZONEFS_SUPER_SIZE,
1121+
REQ_OP_READ);
11211122
if (ret)
11221123
goto free_super;
11231124

0 commit comments

Comments
 (0)