FAILED: patch "[PATCH] dax: check for QUEUE_FLAG_DAX in bdev_dax_supported()" failed to apply to 4.14-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
Quoted 1 line
From
15256f6cc4b44f2e70503758150267fd2a53c0d6Mon Sep 17 00:00:00 2001
From: Ross Zwisler <[email protected]>
Date: Tue, 26 Jun 2018 16:30:40 -0600
Subject: [PATCH] dax: check for QUEUE_FLAG_DAX in bdev_dax_supported()
Add an explicit check for QUEUE_FLAG_DAX to __bdev_dax_supported(). This is needed for DM configurations where the first element in the dm-linear or dm-stripe target supports DAX, but other elements do not. Without this check __bdev_dax_supported() will pass for such devices, letting a filesystem on that device mount with the DAX option.
drivers/dax/super.c +8 -0
@@ -86,6 +86,7 @@ bool __bdev_dax_supported(struct block_device *bdev, int blocksize) {struct dax_device *dax_dev;bool dax_enabled = false; +struct request_queue *q;pgoff_t pgoff;int err, id;void *kaddr;
@@ -99,6 +100,13 @@ bool __bdev_dax_supported(struct block_device *bdev, int blocksize)return false; } + q =bdev_get_queue (bdev); +if (!q || !blk_queue_dax (q)) { +pr_debug ("%s: error: request queue doesn't support dax\n" , +bdevname (bdev, buf)); +return false; + } + err =bdev_dax_pgoff (bdev,0 ,PAGE_SIZE , &pgoff);if (err) { pr_debug("%s: error: unaligned partition for dax\n",