From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
To: Sam Li <faithilikerun@gmail.com>
Cc: Dmitry Fomichev <Dmitry.Fomichev@wdc.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"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: Thu, 16 Mar 2023 06:23:55 +0900 [thread overview]
Message-ID: <a191cacc-121b-717c-d30d-d1003344be39@opensource.wdc.com> (raw)
In-Reply-To: <CAAAx-8+9xaCuYtJCRuvVtMV1czdO6pOCPR6Dirpzf0N0-H6jgg@mail.gmail.com>
On 3/15/23 21:59, Sam Li wrote:
> Damien Le Moal <damien.lemoal@opensource.wdc.com> 于2023年3月14日周二 11:49写道:
>>
>> 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.
>
> I see. That can be done thanks to get_zones_wp() which can show the
> state of the zone at specific position.
I do not think so: a zone wp is invalid for read-only and offline zones. So you
cannot rely on the wp value to detect these states. Even a valid wp value would
not tell you if the zone is read only or offline anyway. You need to track these
states with flags set when doing the first report zone on startup and when doing
a report zone after an IO error.
>
> Sam
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2023-03-15 21:24 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
2023-03-15 12:59 ` Sam Li
2023-03-15 21:23 ` Damien Le Moal [this message]
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=a191cacc-121b-717c-d30d-d1003344be39@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).