archive mirror
 help / color / mirror / Atom feed
From: Coly Li <>
Cc:, Coly Li <>,
	Adrian Huang <>, Jan Kara <>,
	Mike Snitzer <>,
	Pankaj Gupta <>
Subject: [PATCH] dax: fix for do not print error message for non-persistent memory block device
Date: Thu,  3 Sep 2020 19:55:49 +0800	[thread overview]
Message-ID: <> (raw)

When calling __generic_fsdax_supported(), a dax-unsupported device may
not have dax_dev as NULL, e.g. the dax related code block is not enabled
by Kconfig.

Therefore in __generic_fsdax_supported(), to check whether a device
supports DAX or not, the following order should be performed,
- If dax_dev pointer is NULL, it means the device driver explicitly
  announce it doesn't support DAX. Then it is OK to directly return
  false from __generic_fsdax_supported().
- If dax_dev pointer is NOT NULL, it might be because the driver doesn't
  support DAX and not explicitly initialize related data structure. Then
  bdev_dax_supported() should be called for further check.

IMHO if device driver desn't explicitly set its dax_dev pointer to NULL,
this is not a bug. Calling bdev_dax_supported() makes sure they can be
recognized as dax-unsupported eventually.

This patch does the following change for the above purpose,
    -       if (!dax_dev && !bdev_dax_supported(bdev, blocksize)) {
    +       if (!dax_dev || !bdev_dax_supported(bdev, blocksize)) {

Fixes: c2affe920b0e ("dax: do not print error message for non-persistent memory block device")
Signed-off-by: Coly Li <>
Cc: Adrian Huang <>
Cc: Ira Weiny <>
Cc: Jan Kara <>
Cc: Mike Snitzer <>
Cc: Pankaj Gupta <>
Cc: Vishal Verma <>
 drivers/dax/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dax/super.c b/drivers/dax/super.c
index 32642634c1bb..e5767c83ea23 100644
--- a/drivers/dax/super.c
+++ b/drivers/dax/super.c
@@ -100,7 +100,7 @@ bool __generic_fsdax_supported(struct dax_device *dax_dev,
 		return false;
-	if (!dax_dev && !bdev_dax_supported(bdev, blocksize)) {
+	if (!dax_dev || !bdev_dax_supported(bdev, blocksize)) {
 		pr_debug("%s: error: dax unsupported by block device\n",
 				bdevname(bdev, buf));
 		return false;
Linux-nvdimm mailing list --
To unsubscribe send an email to

             reply	other threads:[~2020-09-03 11:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-03 11:55 Coly Li [this message]
2020-09-03 15:26 ` [External] " Adrian Huang12
2020-09-03 16:06 ` Ira Weiny
2020-09-03 16:12   ` Coly Li
2020-09-10 20:29     ` John Pittman
2020-09-11  0:54       ` Coly Li

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:

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

  git send-email \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH] dax: fix for do not print error message for non-persistent memory block device' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox