[SPDK] Re: Why does the flush operation in bdev_nvme do nothing?

Liu, Changpeng <changpeng.liu at intel.com>
Newsgroups dev.linux.lists.spdk
Message-ID <BN6PR11MB2020FDF11455BAE9ED4047A9EEBC9@BN6PR11MB2020.namprd11.prod.outlook.com>
I think you can submit a fix patch.

If FLUSH IO type is supported, then call spdk_nvme_ns_cmd_flush.

> -----Original Message-----
> From: fandahao17(a)mail.ustc.edu.cn <fandahao17(a)mail.ustc.edu.cn>
> Sent: Monday, January 25, 2021 7:51 PM
> To: spdk(a)lists.01.org
> Subject: [SPDK] Why does the flush operation in bdev_nvme do nothing?
> 
> Hi, there! I ran into the following code in module/bdev/nvme/bdev_nvme.c
> when I wanted to force a flush into my SSD to make sure all my previous writes
> are durable.
> 
> static int
> bdev_nvme_flush(struct spdk_nvme_ns *ns, struct spdk_nvme_qpair *qpair,
> 		struct nvme_bdev_io *bio, uint64_t offset, uint64_t nbytes)
> {
> 	spdk_bdev_io_complete(spdk_bdev_io_from_ctx(bio),
> SPDK_BDEV_IO_STATUS_SUCCESS);
> 	return 0;
> }
> 
> Seems that it just completes without issuing any nvme FLUSH commands. This
> interests me because I thought it would call something like
> spdk_nvme_ns_cmd_flush(). I am curious how can I make sure the data is
> written into the non-volatile media of the SSD? Can I still guarantee the write-
> read order without using a FLUSH operation in between? Thanks!
> _______________________________________________
> SPDK mailing list -- spdk(a)lists.01.org
> To unsubscribe send an email to spdk-leave(a)lists.01.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.