aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikhail Skorzhinskii <mskorzhinskiy@solarflare.com>2019-07-04 03:59:18 -0400
committerChristoph Hellwig <hch@lst.de>2019-07-09 17:18:09 -0400
commit958f2a0f8121ae36a5cbff383ab94fadf1fba5eb (patch)
tree9865f7bbe0262c4a5064e6ec5bb6dc230a88f7ee
parent5ba895033b8e8257451e6f85e6e516c3b3ce1a68 (diff)
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 <mskorzhinskiy@solarflare.com> Signed-off-by: Mike Playle <mplayle@solarflare.com> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r--drivers/nvme/host/core.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 5417110cbf1b..f4340dc1d399 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -11,6 +11,7 @@
11#include <linux/hdreg.h> 11#include <linux/hdreg.h>
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/backing-dev.h>
14#include <linux/list_sort.h> 15#include <linux/list_sort.h>
15#include <linux/slab.h> 16#include <linux/slab.h>
16#include <linux/types.h> 17#include <linux/types.h>
@@ -3304,6 +3305,10 @@ static int nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)
3304 goto out_free_ns; 3305 goto out_free_ns;
3305 } 3306 }
3306 3307
3308 if (ctrl->opts->data_digest)
3309 ns->queue->backing_dev_info->capabilities
3310 |= BDI_CAP_STABLE_WRITES;
3311
3307 blk_queue_flag_set(QUEUE_FLAG_NONROT, ns->queue); 3312 blk_queue_flag_set(QUEUE_FLAG_NONROT, ns->queue);
3308 if (ctrl->ops->flags & NVME_F_PCI_P2PDMA) 3313 if (ctrl->ops->flags & NVME_F_PCI_P2PDMA)
3309 blk_queue_flag_set(QUEUE_FLAG_PCI_P2PDMA, ns->queue); 3314 blk_queue_flag_set(QUEUE_FLAG_PCI_P2PDMA, ns->queue);