Option to never do BLKRRPART ioctl in nvme format?

Daniel Wagner dwagner at suse.de
Mon Jan 30 01:47:27 PST 2023


Hi Nick,

On Fri, Jan 06, 2023 at 01:28:52PM -0600, Nick Neumann wrote:
> The nvme format command, as its documentation states, issues BLKRRPART
> ioctl after successful format.
> 
> It feels odd that after a successful format, the format command can
> still return an error code because BLKRRPART ioctl fails.
> 
> When initially added, the BLKRRPART ioctl was issued but its return
> value was ignored. Later[1], the return value started being checked
> and returned. And over time [2,3], cases were added where BLKRRPART is
> not issued.
> 
> I'm wondering if all of this, combined with apparent race conditions
> I've hit where BLKRRPART can fail after successful format, are a sign
> that there should be a way to do an nvme format without BLKRRPART
> ioctl.

I can't really say why BLKRRPART was added initially. The comment which was
added later on

/*
 * If block size has been changed by the format
 * command up there, we should notify it to
 * kernel blkdev to update its own block size
 * to the given one because blkdev will not
 * update by itself without re-opening fd.
 */

indicates we don't need BLKRRPART necessary. I would like to understand first
what's going on before dropping BLKRRPART.

@Keith, do you happen to remember what's the reason for BLKRRPART?

Thanks,
Daniel



More information about the Linux-nvme mailing list