Linux block layer
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Johannes Thumshirn <johannes.thumshirn@wdc.com>,
	"axboe@kernel.dk" <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH v2] zloop: print device that had errors
Date: Mon, 19 Oct 2026 17:19:50 +0200	[thread overview]
Message-ID: <98713429-e513-4648-8834-71d6b2ab1d5b@kernel.org> (raw)
In-Reply-To: <20261019150936.1819956-1-johannes.thumshirn@wdc.com>

On 2026/10/19 17:09, Johannes Thumshirn wrote:
> When testing zoned filesystems that span multiple zloop drives it can be
> difficult to figure out which devices access caused an error.
> 
> Prefix the error messages where we have the disk available with the disk
> name.
> 
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> Reviewed-by: Reviewed-by: Damien Le Moal <dlemoal@kernel.org>

A single Reviewed-by tag is enough :)

> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> ---
> Changes to v1:
> - Based on for-7.4/block
> - Add reviews
> 
>  drivers/block/zloop.c | 37 +++++++++++++++++++++----------------
>  1 file changed, 21 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/block/zloop.c b/drivers/block/zloop.c
> index 509d9727835d..73d9949d01e0 100644
> --- a/drivers/block/zloop.c
> +++ b/drivers/block/zloop.c
> @@ -318,22 +318,23 @@ static int zloop_update_seq_zone(struct zloop_device *zlo, unsigned int zone_no)
>  
>  	ret = vfs_getattr(&zone->file->f_path, &stat, STATX_SIZE, 0);
>  	if (ret < 0) {
> -		pr_err("Failed to get zone %u file stat (err=%d)\n",
> -		       zone_no, ret);
> +		pr_err("%pg: Failed to get zone %u file stat (err=%d)\n",
> +		       zlo->disk->part0, zone_no, ret);
>  		set_bit(ZLOOP_ZONE_SEQ_ERROR, &zone->flags);
>  		return ret;
>  	}
>  
>  	file_sectors = stat.size >> SECTOR_SHIFT;
>  	if (file_sectors > zlo->zone_capacity) {
> -		pr_err("Zone %u file too large (%llu sectors > %llu)\n",
> -		       zone_no, file_sectors, zlo->zone_capacity);
> +		pr_err("%pg: Zone %u file too large (%llu sectors > %llu)\n",
> +		       zlo->disk->part0, zone_no, file_sectors,
> +		       zlo->zone_capacity);
>  		return -EINVAL;
>  	}
>  
>  	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);
> +		pr_err("%pg: Zone %u file size (%llu) not aligned to block size %u\n",
> +		       zlo->disk->part0, zone_no, stat.size, zlo->block_size);
>  		return -EINVAL;
>  	}
>  
> @@ -604,12 +605,14 @@ static int zloop_seq_write_prep(struct zloop_cmd *cmd)
>  	} else {
>  		if (cmd->sector != zone->wp) {
>  			if (zone->wp == ULLONG_MAX)
> -				pr_err("Zone %u: write to %s zone: sect %llu\n",
> -				       zone_no, blk_zone_cond_str(zone->cond),
> +				pr_err("%pg: Zone %u: write to %s zone: sect %llu\n",
> +				       zlo->disk->part0, zone_no,
> +				       blk_zone_cond_str(zone->cond),
>  				       cmd->sector);
>  			else
> -				pr_err("Zone %u: unaligned write: sect %llu, wp %llu\n",
> -				       zone_no, cmd->sector, zone->wp);
> +				pr_err("%pg: Zone %u: unaligned write: sect %llu, wp %llu\n",
> +				       zlo->disk->part0, zone_no, cmd->sector,
> +				       zone->wp);
>  			ret = -EIO;
>  			goto out_unlock;
>  		}
> @@ -816,8 +819,9 @@ static void zloop_complete_rq(struct request *rq)
>  	switch (req_op(rq)) {
>  	case REQ_OP_READ:
>  		if (cmd->ret < 0)
> -			pr_err("Zone %u: failed read sector %llu, %llu sectors\n",
> -			       zone_no, cmd->sector, cmd->nr_sectors);
> +			pr_err("%pg: Zone %u: failed read sector %llu, %llu sectors\n",
> +			       zlo->disk->part0, zone_no, cmd->sector,
> +			       cmd->nr_sectors);
>  
>  		if (cmd->ret >= 0 && cmd->ret != blk_rq_bytes(rq)) {
>  			/* short read */
> @@ -830,14 +834,15 @@ static void zloop_complete_rq(struct request *rq)
>  	case REQ_OP_WRITE:
>  	case REQ_OP_ZONE_APPEND:
>  		if (cmd->ret < 0)
> -			pr_err("Zone %u: failed %swrite sector %llu, %llu sectors\n",
> -			       zone_no,
> +			pr_err("%pg: Zone %u: failed %swrite sector %llu, %llu sectors\n",
> +			       zlo->disk->part0, zone_no,
>  			       req_op(rq) == REQ_OP_WRITE ? "" : "append ",
>  			       cmd->sector, cmd->nr_sectors);
>  
>  		if (cmd->ret >= 0 && cmd->ret != blk_rq_bytes(rq)) {
> -			pr_err("Zone %u: partial write %ld/%u B\n",
> -			       zone_no, cmd->ret, blk_rq_bytes(rq));
> +			pr_err("%pg: Zone %u: partial write %ld/%u B\n",
> +			       zlo->disk->part0, zone_no, cmd->ret,
> +			       blk_rq_bytes(rq));
>  			cmd->ret = -EIO;
>  		}
>  
> 
> base-commit: afc9cde716b29ce814798d649a95f9128ba42b43


-- 
Damien Le Moal
Western Digital Research

  reply	other threads:[~2026-10-19 15:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-19 15:09 [PATCH v2] zloop: print device that had errors Johannes Thumshirn
2026-10-19 15:19 ` Damien Le Moal [this message]
2026-10-19 15:20   ` Johannes Thumshirn
2026-10-19 19:13 ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=98713429-e513-4648-8834-71d6b2ab1d5b@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=johannes.thumshirn@wdc.com \
    --cc=linux-block@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox