Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

nvme: multipath: enable BLK_FEAT_ATOMIC_WRITES for multipathing

A change to QEMU resulted in all nvme controllers (single and
multi-controller subsystems) to have its CMIC.MCTRS bit set which
indicates the subsystem supports multiple controllers and it is possible
a namespace can be shared between those multiple controllers in a
multipath configuration.

When a namespace of a CMIC.MCTRS enabled subsystem is allocated, a
multipath node is created. The queue limits for this node are inherited
from the namespace being allocated. When inheriting queue limits, the
features being inherited need to be specified. The atomic write feature
(BLK_FEAT_ATOMIC_WRITES) was not specified so the atomic queue limits
were not inherited by the multipath disk node which resulted in the sysfs
atomic write attributes being zeroed. The fix is to include
BLK_FEAT_ATOMIC_WRITES in the list of features to be inherited.

Signed-off-by: Alan Adamson <alan.adamson@oracle.com>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>

authored by

Alan Adamson and committed by
Christoph Hellwig
a21675ee 8113d610

+2 -1
+2 -1
drivers/nvme/host/multipath.c
··· 638 638 639 639 blk_set_stacking_limits(&lim); 640 640 lim.dma_alignment = 3; 641 - lim.features |= BLK_FEAT_IO_STAT | BLK_FEAT_NOWAIT | BLK_FEAT_POLL; 641 + lim.features |= BLK_FEAT_IO_STAT | BLK_FEAT_NOWAIT | 642 + BLK_FEAT_POLL | BLK_FEAT_ATOMIC_WRITES; 642 643 if (head->ids.csi == NVME_CSI_ZNS) 643 644 lim.features |= BLK_FEAT_ZONED; 644 645