From: Yoav Cohen <yoav@nvidia.com>
To: Alexander Atanasov <alex@zkern.zazolabs.com>,
Ming Lei <ming.lei@redhat.com>, Jens Axboe <axboe@kernel.dk>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
"csander@purestorage.com" <csander@purestorage.com>
Cc: Jared Holzman <jholzman@nvidia.com>, Omri Levi <omril@nvidia.com>
Subject: Re: [PATCH v4 2/2] ublk: add UBLK_CMD_TRY_STOP_DEV command
Date: Sun, 18 Jan 2026 14:09:10 +0000 [thread overview]
Message-ID: <fb2d4e85-d1cc-4e8c-b22c-e1f982b2a9a6@nvidia.com> (raw)
In-Reply-To: <922b4c45-14ba-497b-8a00-eac2903a2854@zkern.zazolabs.com>
On 18/01/2026 16:06, Alexander Atanasov wrote:
> External email: Use caution opening links or attachments
>
>
> On 6.01.26 22:33, Yoav Cohen wrote:
>> This command is similar to UBLK_CMD_STOP_DEV, but it only stops the
>> device if there are no active openers for the ublk block device.
>> If the device is busy, the command returns -EBUSY instead of
>> disrupting active clients. This allows safe, non-destructive stopping.
>>
>> Advertise UBLK_CMD_TRY_STOP_DEV support via UBLK_F_SAFE_STOP_DEV
>> feature flag.
>>
>> Signed-off-by: Yoav Cohen <yoav@nvidia.com>
>> ---
>> drivers/block/ublk_drv.c | 44 ++++++++++++++++++++++++++--
>> include/uapi/linux/ublk_cmd.h | 9 +++++-
>> tools/testing/selftests/ublk/kublk.c | 1 +
>> 3 files changed, 51 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c
>> index 2d5602ef05cc..fc8b87902f8f 100644
>> --- a/drivers/block/ublk_drv.c
>> +++ b/drivers/block/ublk_drv.c
>> @@ -54,6 +54,7 @@
>> #define UBLK_CMD_DEL_DEV_ASYNC _IOC_NR(UBLK_U_CMD_DEL_DEV_ASYNC)
> [snip]
>
>
>> @@ -919,6 +923,9 @@ static int ublk_open(struct gendisk *disk,
>> blk_mode_t mode)
>> return -EPERM;
>> }
>>
>> + if (ub->block_open)
>> + return -EBUSY;
>> +
>
> Why back to EBUSY?
>
>
This is an old patch version - v7 was already pushed with your comments
applied(-ENXIO)
prev parent reply other threads:[~2026-01-18 14:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-06 20:33 [PATCH v4 0/2] ublk: introduce UBLK_CMD_TRY_STOP_DEV Yoav Cohen
2026-01-06 20:33 ` [PATCH v4 1/2] ublk: make ublk_ctrl_stop_dev return void Yoav Cohen
2026-01-06 20:33 ` [PATCH v4 2/2] ublk: add UBLK_CMD_TRY_STOP_DEV command Yoav Cohen
2026-01-07 13:20 ` Ming Lei
2026-01-07 13:34 ` Yoav Cohen
2026-01-07 14:34 ` Ming Lei
2026-01-07 21:04 ` Yoav Cohen
[not found] ` <922b4c45-14ba-497b-8a00-eac2903a2854@zkern.zazolabs.com>
2026-01-18 14:09 ` Yoav Cohen [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=fb2d4e85-d1cc-4e8c-b22c-e1f982b2a9a6@nvidia.com \
--to=yoav@nvidia.com \
--cc=alex@zkern.zazolabs.com \
--cc=axboe@kernel.dk \
--cc=csander@purestorage.com \
--cc=jholzman@nvidia.com \
--cc=linux-block@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=omril@nvidia.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