From: John Garry <john.g.garry@oracle.com>
To: Nilay Shroff <nilay@linux.ibm.com>,
shinichiro.kawasaki@wdc.com, linux-block@vger.kernel.org
Cc: hch@lst.de, linux-nvme@lists.infradead.org, dwagner@suse.de,
John Garry <john.garry@linux.dev>
Subject: Re: [PATCH v4] nvme/069: add a test for multipath cdev lifetime
Date: Fri, 17 Jul 2026 10:06:09 +0100 [thread overview]
Message-ID: <4a7868c2-a67c-4bfd-bf61-58131a98c97a@oracle.com> (raw)
In-Reply-To: <99842431-3ffa-412a-af57-e284888342a7@linux.ibm.com>
On 17/07/2026 08:00, Nilay Shroff wrote:
> On 7/16/26 10: 06 PM, John Garry wrote: > On 16/07/2026 16: 16, Nilay Shroff
> wrote: >>> + kill(getppid(), SIGUSR2); >>> + count = 0; >>> + for (;;)
> { >>> + fd1 = open(argv[1], O_RDONLY); >>>
>
>
> On 7/16/26 10:06 PM, John Garry wrote:
>> On 16/07/2026 16:16, Nilay Shroff wrote:
>>>> + kill(getppid(), SIGUSR2);
>>>> + count = 0;
>>>> + for (;;) {
>>>> + fd1 = open(argv[1], O_RDONLY);
>>>> + usleep(500000);
>>>> + if (fd1 < 0)
>>>> + break;
>>>
>>> Does it make sense to check for errno set to ENODEV or ENOENT
>>> before breaking out here?
>>
>> ehh, if the errno is not ENODEV or ENOENT, then how to handle? Would it to fail the test due to unexpected errno?
>
> I think yes, something like below:
>
> for (;;) {
> fd1 = open(argv[1], O_RDONLY);
> if (fd1 < 0) {
> if (errno == EINTR)
> continue;
>
> if (errno == ENOENT || errno == ENODEV)
> break;
>
> perror("open");
if fd1 < 0, how is it open? Or maybe this message is too vague...
> return EINVAL;
So are ENOENT, ENODEV, and EINTR the only expected error codes? Others
are just unsupported and we fail the test (if and when we get them), right?
> }
>
> close(fd1);
> usleep(500000);
>
> if (++count > 10) {
> fprintf(stderr, "%s still present\n", argv[0]);
> return EINVAL;
> }
> }
>
> Thanks,
> --Nilay
>
next prev parent reply other threads:[~2026-07-17 9:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-16 8:29 [PATCH v4] nvme/069: add a test for multipath cdev lifetime John Garry
2026-07-16 15:16 ` Nilay Shroff
2026-07-16 16:36 ` John Garry
2026-07-17 7:00 ` Nilay Shroff
2026-07-17 9:06 ` John Garry [this message]
2026-07-17 9:49 ` Nilay Shroff
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=4a7868c2-a67c-4bfd-bf61-58131a98c97a@oracle.com \
--to=john.g.garry@oracle.com \
--cc=dwagner@suse.de \
--cc=hch@lst.de \
--cc=john.garry@linux.dev \
--cc=linux-block@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=nilay@linux.ibm.com \
--cc=shinichiro.kawasaki@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox