All of lore.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
To: Dmitry Fomichev <Dmitry.Fomichev@wdc.com>,
	"faithilikerun@gmail.com" <faithilikerun@gmail.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: "hreitz@redhat.com" <hreitz@redhat.com>,
	"hare@suse.de" <hare@suse.de>,
	"sgarzare@redhat.com" <sgarzare@redhat.com>,
	"mehta.aaru20@gmail.com" <mehta.aaru20@gmail.com>,
	"stefanha@redhat.com" <stefanha@redhat.com>,
	"fam@euphon.net" <fam@euphon.net>,
	"qemu-block@nongnu.org" <qemu-block@nongnu.org>,
	"kwolf@redhat.com" <kwolf@redhat.com>,
	"jusual@redhat.com" <jusual@redhat.com>
Subject: Re: [PATCH v6 1/4] file-posix: add tracking of the zone write pointers
Date: Tue, 14 Mar 2023 12:49:45 +0900	[thread overview]
Message-ID: <0ab0bafd-6e21-2f4d-8d73-8c6683b6d1dd@opensource.wdc.com> (raw)
In-Reply-To: <e143490361477503b5e7bba43e79f369e3cd7d9b.camel@wdc.com>

On 3/14/23 11:23, Dmitry Fomichev wrote:
>> @@ -3339,10 +3473,27 @@ static int coroutine_fn
>> raw_co_zone_mgmt(BlockDriverState *bs, BlockZoneOp op,
>>                          len >> BDRV_SECTOR_BITS);
>>      ret = raw_thread_pool_submit(bs, handle_aiocb_zone_mgmt, &acb);
>>      if (ret != 0) {
>> +        update_zones_wp(s->fd, wps, offset, index);
>>          ret = -errno;
>>          error_report("ioctl %s failed %d", op_name, ret);
>> +        goto out;
>>      }
>>  
>> +    if (zo == BLKRESETZONE && len == capacity) {
>> +        for (int i = 0; i < bs->bl.nr_zones; ++i) {
>> +            if (!BDRV_ZT_IS_CONV(wps->wp[i])) {
>> +                wps->wp[i] = i * bs->bl.zone_size;
> 
> This will reset write pointers of all read-only zones that may exist on the
> device and make the data stored in those zones unreadable. R/O zones need to be
> skipped in this loop.

And offline zones need to be skipped as well.

-- 
Damien Le Moal
Western Digital Research



  reply	other threads:[~2023-03-14  3:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10 10:31 [PATCH v6 0/4] Add zone append write for zoned device Sam Li
2023-03-10 10:31 ` [PATCH v6 1/4] file-posix: add tracking of the zone write pointers Sam Li
2023-03-14  2:23   ` Dmitry Fomichev
2023-03-14  3:49     ` Damien Le Moal [this message]
2023-03-15 12:59       ` Sam Li
2023-03-15 21:23         ` Damien Le Moal
2023-03-16 18:51   ` Stefan Hajnoczi
2023-03-10 10:31 ` [PATCH v6 2/4] block: introduce zone append write for zoned devices Sam Li
2023-03-14  2:55   ` Dmitry Fomichev
2023-03-16 18:56   ` Stefan Hajnoczi
2023-03-10 10:31 ` [PATCH v6 3/4] qemu-iotests: test zone append operation Sam Li
2023-03-16 18:59   ` Stefan Hajnoczi
2023-03-10 10:31 ` [PATCH v6 4/4] block: add some trace events for zone append Sam Li
2023-03-14  2:28   ` Dmitry Fomichev

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=0ab0bafd-6e21-2f4d-8d73-8c6683b6d1dd@opensource.wdc.com \
    --to=damien.lemoal@opensource.wdc.com \
    --cc=Dmitry.Fomichev@wdc.com \
    --cc=faithilikerun@gmail.com \
    --cc=fam@euphon.net \
    --cc=hare@suse.de \
    --cc=hreitz@redhat.com \
    --cc=jusual@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mehta.aaru20@gmail.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sgarzare@redhat.com \
    --cc=stefanha@redhat.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.