All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Cc: David Sterba <dsterba@suse.com>,
	Naohiro Aota <naohiro.aota@wdc.com>,
	linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2 2/2] btrfs: zoned: bail out if we can't read a reliable write pointer
Date: Thu, 6 May 2021 00:52:26 +0200	[thread overview]
Message-ID: <20210505225226.GR7604@twin.jikos.cz> (raw)
In-Reply-To: <20210504083024.28072-3-johannes.thumshirn@wdc.com>

On Tue, May 04, 2021 at 10:30:24AM +0200, Johannes Thumshirn wrote:
> +			btrfs_err(fs_info,
> +				  "zoned: cannot read write pointer for zone %llu",
> +				  physical >> ilog2(fs_info->zone_size));

This converts the offset to the zone index, I think we should keep it
consistent, one way or another. The other message was printing the raw
offset (pysical or logical) and this is IMHO more friendly as this is
related to other on-disk structures. Translation to the zone index can
be done but the offset is not dependent on the device so I'd prefer
that. I've checked other messages and there are always raw offsets so
I've switched that back to the 'physical'.

> +			ret = -EIO;
> +			goto out;
> +		}
>  		cache->alloc_offset = alloc_offsets[0];
>  		break;
>  	case BTRFS_BLOCK_GROUP_DUP:
> @@ -1208,6 +1215,13 @@ int btrfs_load_block_group_zone_info(struct btrfs_block_group *cache, bool new)
>  	}
>  
>  out:
> +	if (cache->alloc_offset > fs_info->zone_size) {
> +		btrfs_err(fs_info,
> +			  "zoned: write pointer %llu in BG %llu behind end of zone",

s/BG/block group/

And I've added the block group start as this is an anchor for any
potential debugging.

> +			  cache->alloc_offset, logical);
> +		ret = -EIO;
> +	}
> +
>  	/* An extent is allocated after the write pointer */
>  	if (!ret && num_conventional && last_alloc > cache->alloc_offset) {
>  		btrfs_err(fs_info,
> -- 
> 2.31.1

      reply	other threads:[~2021-05-05 22:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-04  8:30 [PATCH v2 0/2] btrfs: zoned: two fixes for generic/475 Johannes Thumshirn
2021-05-04  8:30 ` [PATCH v2 1/2] btrfs: zoned: sanity check zone type Johannes Thumshirn
2021-05-05 22:30   ` David Sterba
2021-05-12 22:30   ` David Sterba
2021-05-17  7:11     ` Johannes Thumshirn
2021-05-04  8:30 ` [PATCH v2 2/2] btrfs: zoned: bail out if we can't read a reliable write pointer Johannes Thumshirn
2021-05-05 22:52   ` David Sterba [this message]

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=20210505225226.GR7604@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=dsterba@suse.com \
    --cc=johannes.thumshirn@wdc.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=naohiro.aota@wdc.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.