Skip to content

Commit 958f2a0

Browse files
sf-rasmiChristoph Hellwig
authored andcommitted
nvme-tcp: set the STABLE_WRITES flag when data digests are enabled
There was a few false alarms sighted on target side about wrong data digest while performing high throughput load to XFS filesystem shared through NVMoF TCP. This flag tells the rest of the kernel to ensure that the data buffer does not change while the write is in flight. It incurs a performance penalty, so only enable it when it is actually needed, i.e. when we are calculating data digests. Although even with this change in place, ext2 users can steel experience false positives, as ext2 is not respecting this flag. This may be apply to vfat as well. Signed-off-by: Mikhail Skorzhinskii <[email protected]> Signed-off-by: Mike Playle <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 5ba8950 commit 958f2a0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/nvme/host/core.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/hdreg.h>
1212
#include <linux/kernel.h>
1313
#include <linux/module.h>
14+
#include <linux/backing-dev.h>
1415
#include <linux/list_sort.h>
1516
#include <linux/slab.h>
1617
#include <linux/types.h>
@@ -3304,6 +3305,10 @@ static int nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)
33043305
goto out_free_ns;
33053306
}
33063307

3308+
if (ctrl->opts->data_digest)
3309+
ns->queue->backing_dev_info->capabilities
3310+
|= BDI_CAP_STABLE_WRITES;
3311+
33073312
blk_queue_flag_set(QUEUE_FLAG_NONROT, ns->queue);
33083313
if (ctrl->ops->flags & NVME_F_PCI_P2PDMA)
33093314
blk_queue_flag_set(QUEUE_FLAG_PCI_P2PDMA, ns->queue);

0 commit comments

Comments
 (0)