[PATCHv4 13/13] nvmet: report ns's vwc not present
Guixin Liu
kanie at linux.alibaba.com
Sat Nov 9 06:59:19 PST 2024
在 2024/11/9 00:15, Keith Busch 写道:
> 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))
Or just remove !req->ns->buffered_io check? All file backend return
support vwc.
Best Regards,
Guixin Liu
More information about the Linux-nvme
mailing list