Skip to content

Commit 6466b21

Browse files
Christoph Hellwigaxboe
authored andcommitted
zloop: improve the unaligned write pointer warning
Use the IS_ALIGNED helper and avoid extra conversions, and tell the user what the unaligned size is. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Damien Le Moal <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 14e0077 commit 6466b21

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/block/zloop.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,9 @@ static int zloop_update_seq_zone(struct zloop_device *zlo, unsigned int zone_no)
313313
return -EINVAL;
314314
}
315315

316-
if (file_sectors & ((zlo->block_size >> SECTOR_SHIFT) - 1)) {
317-
pr_err("Zone %u file size not aligned to block size %u\n",
318-
zone_no, zlo->block_size);
316+
if (!IS_ALIGNED(stat.size, zlo->block_size)) {
317+
pr_err("Zone %u file size (%llu) not aligned to block size %u\n",
318+
zone_no, stat.size, zlo->block_size);
319319
return -EINVAL;
320320
}
321321

0 commit comments

Comments
 (0)