[PATCHv4 13/13] nvmet: report ns's vwc not present

Keith Busch kbusch at kernel.org
Fri Nov 8 08:15:47 PST 2024


On Fri, Nov 08, 2024 at 03:27:43PM +0100, Christoph Hellwig wrote:
> On Thu, Nov 07, 2024 at 11:38:48AM -0800, Keith Busch wrote:
> > diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c
> > index 516af7b419189..f688d7fdf7d67 100644
> > --- a/drivers/nvme/target/admin-cmd.c
> > +++ b/drivers/nvme/target/admin-cmd.c
> > @@ -915,6 +915,9 @@ static void nvmet_execute_id_cs_indep(struct nvmet_req *req)
> >  		id->nsattr |= NVME_NS_ATTR_RO;
> >  	if (req->ns->bdev && !bdev_nonrot(req->ns->bdev))
> >  		id->nsfeat |= NVME_NS_ROTATIONAL;
> > +	if ((req->ns->file && !req->ns->buffered_io) ||
> 
> I don't think this check is correct.  Direct I/O still requires cache
> flushes for durability.

Oh, right. Would it be sufficient to check the file's block device for
write caching?

	if ((req->ns->file && !req->ns->buffered_io &&
		bdev_write_cache(file_inode(req->ns->file)->i_sb->s_bdev))



More information about the Linux-nvme mailing list