From: Christoph Hellwig Date: Tue, 14 Apr 2026 08:17:48 +0000 (+0200) Subject: zloop: improve the unaligned write pointer warning X-Git-Tag: v7.1-rc1~10^2~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6466b211f797ae88073b5826dd764a6a98b67edb;p=thirdparty%2Fkernel%2Flinux.git 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 Reviewed-by: Damien Le Moal Reviewed-by: Johannes Thumshirn Link: https://patch.msgid.link/20260414081811.549755-4-hch@lst.de Signed-off-by: Jens Axboe --- diff --git a/drivers/block/zloop.c b/drivers/block/zloop.c index fc54480ed62d..a738f8629062 100644 --- a/drivers/block/zloop.c +++ b/drivers/block/zloop.c @@ -313,9 +313,9 @@ static int zloop_update_seq_zone(struct zloop_device *zlo, unsigned int zone_no) return -EINVAL; } - if (file_sectors & ((zlo->block_size >> SECTOR_SHIFT) - 1)) { - pr_err("Zone %u file size not aligned to block size %u\n", - zone_no, zlo->block_size); + if (!IS_ALIGNED(stat.size, zlo->block_size)) { + pr_err("Zone %u file size (%llu) not aligned to block size %u\n", + zone_no, stat.size, zlo->block_size); return -EINVAL; }