All of lore.kernel.org
 help / color / mirror / Atom feed
From: gregkh@linuxfoundation.org
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Jeffle Xu <jefflexu@linux.alibaba.com>,
	Mike Snitzer <snitzer@redhat.com>
Subject: [PATCH 4.9 07/11] dm table: fix DAX iterate_devices based device capability checks
Date: Wed, 10 Mar 2021 14:25:06 +0100	[thread overview]
Message-ID: <20210310132320.632132455@linuxfoundation.org> (raw)
In-Reply-To: <20210310132320.393957501@linuxfoundation.org>

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

From: Jeffle Xu <jefflexu@linux.alibaba.com>

commit 5b0fab508992c2e120971da658ce80027acbc405 upstream.

Fix dm_table_supports_dax() and invert logic of both
iterate_devices_callout_fn so that all devices' DAX capabilities are
properly checked.

Fixes: 545ed20e6df6 ("dm: add infrastructure for DAX support")
Cc: stable@vger.kernel.org
Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
[jeffle: no dax write cache, no dax synchronous]
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/md/dm-table.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -848,12 +848,12 @@ void dm_table_set_type(struct dm_table *
 }
 EXPORT_SYMBOL_GPL(dm_table_set_type);
 
-static int device_supports_dax(struct dm_target *ti, struct dm_dev *dev,
-			       sector_t start, sector_t len, void *data)
+static int device_not_dax_capable(struct dm_target *ti, struct dm_dev *dev,
+				  sector_t start, sector_t len, void *data)
 {
 	struct request_queue *q = bdev_get_queue(dev->bdev);
 
-	return q && blk_queue_dax(q);
+	return q && !blk_queue_dax(q);
 }
 
 static bool dm_table_supports_dax(struct dm_table *t)
@@ -869,7 +869,7 @@ static bool dm_table_supports_dax(struct
 			return false;
 
 		if (!ti->type->iterate_devices ||
-		    !ti->type->iterate_devices(ti, device_supports_dax, NULL))
+		    ti->type->iterate_devices(ti, device_not_dax_capable, NULL))
 			return false;
 	}
 



  parent reply	other threads:[~2021-03-10 13:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-10 13:24 [PATCH 4.9 00/11] 4.9.261-rc1 review gregkh
2021-03-10 13:25 ` [PATCH 4.9 01/11] btrfs: raid56: simplify tracking of Q stripe presence gregkh
2021-03-10 13:25 ` [PATCH 4.9 02/11] btrfs: fix raid6 qstripe kmap gregkh
2021-03-10 13:25 ` [PATCH 4.9 03/11] usbip: tools: fix build error for multiple definition gregkh
2021-03-10 13:25 ` [PATCH 4.9 04/11] ALSA: ctxfi: cthw20k2: fix mask on conf to allow 4 bits gregkh
2021-03-10 13:25 ` [PATCH 4.9 05/11] rsxx: Return -EFAULT if copy_to_user() fails gregkh
2021-03-10 13:25 ` [PATCH 4.9 06/11] dm table: fix iterate_devices based device capability checks gregkh
2021-03-10 13:25 ` gregkh [this message]
2021-03-10 13:25 ` [PATCH 4.9 08/11] iommu/amd: Fix sleeping in atomic in increase_address_space() gregkh
2021-03-10 13:25 ` [PATCH 4.9 09/11] platform/x86: acer-wmi: Add new force_caps module parameter gregkh
2021-03-10 13:25 ` [PATCH 4.9 10/11] PCI: Add function 1 DMA alias quirk for Marvell 9215 SATA controller gregkh
2021-03-10 13:25 ` [PATCH 4.9 11/11] misc: eeprom_93xx46: Add quirk to support Microchip 93LC46B eeprom gregkh
2021-03-10 22:00 ` [PATCH 4.9 00/11] 4.9.261-rc1 review Shuah Khan
2021-03-10 23:50 ` Guenter Roeck
2021-03-11  4:27 ` Florian Fainelli
2021-03-11  7:59 ` Jon Hunter
2021-03-11  8:35 ` Naresh Kamboju

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210310132320.632132455@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=jefflexu@linux.alibaba.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=snitzer@redhat.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.