[PATCH v3] nvmet: avoid unnecessary flush bio

Chaitanya Kulkarni chaitanyak at nvidia.com
Wed Aug 3 23:46:13 PDT 2022


On 7/28/22 20:53, Guixin Liu wrote:
> For no volatile write cache block device backend, sending flush bio is
> unnecessary, avoid to do that.
> 
> Signed-off-by: Guixin Liu <kanie at linux.alibaba.com>
> ---
> 
> Changes on v3:
> - Remove file backend change.
> 
> Changes on v2:
> - Use bdev_write_cache instead of open code.
> - Use NVME_SC_SUCCESS instead of translation, and remove "else".
> 
> Test log:
> - Add printk log at new if branch.
> - Use nvme_loop to emulate nvme device.
> - Use tcm_loop and tcmu to emulate no volatile write cache block backend
>    by setting emulate_write_cache=0.
> - Send "nvme flush /dev/nvme0n1", there is a log print, and cmd return success.
> - Send "nvme set-feature /dev/nvme0n1 --namespace-id=1 --feature-id=0x84 --value=1",
>    there is a log print, and cmd return success.
> - Format nvme0n1 to ext4 filesystem, then create a file, write data and save, there
>    is a log print, and no error.
> 
>   drivers/nvme/target/io-cmd-bdev.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 

Thanks for the test report, looks good.

Reviewed-by: Chaitanya Kulkarni <kch at nvidia.com>

-ck




More information about the Linux-nvme mailing list