From: Mike Snitzer <snitzer@redhat.com>
To: Coly Li <colyli@suse.de>
Cc: Pankaj Gupta <pankaj.gupta.linux@gmail.com>,
linux-nvdimm@lists.01.org,
Vishal Verma <vishal.l.verma@intel.com>,
dm-devel@redhat.com, Adrian Huang <ahuang12@lenovo.com>,
Jan Kara <jack@suse.com>, Ira Weiny <ira.weiny@intel.com>
Subject: Re: [PATCH v2] dax: fix for do not print error message for non-persistent memory block device
Date: Thu, 3 Sep 2020 12:00:05 -0400 [thread overview]
Message-ID: <20200903160005.GA11871@redhat.com> (raw)
In-Reply-To: <20200903152839.19040-1-colyli@suse.de>
On Thu, Sep 03 2020 at 11:28am -0400,
Coly Li <colyli@suse.de> wrote:
> 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)) {
Don't think I've ever seen a one-liner fix document the diff in its
patch header. Really no need for that.
> Fixes: c2affe920b0e ("dax: do not print error message for non-persistent memory block device")
> Signed-off-by: Coly Li <colyli@suse.de>
> Reviewed-and-Tested-by: Adrian Huang <ahuang12@lenovo.com>
> Cc: Ira Weiny <ira.weiny@intel.com>
> Cc: Jan Kara <jack@suse.com>
> Cc: Mike Snitzer <snitzer@redhat.com>
> Cc: Pankaj Gupta <pankaj.gupta.linux@gmail.com>
> Cc: Vishal Verma <vishal.l.verma@intel.com>
Thanks for fixing this,
Reviewed-by: Mike Snitzer <snitzer@redhat.com>
> ---
> Changelog:
> v2: add Reviewed-and-Tested-by from Adrian Huang.
> v1: initial version.
>
> 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;
> --
> 2.26.2
>
WARNING: multiple messages have this Message-ID (diff)
From: Mike Snitzer <snitzer@redhat.com>
To: Coly Li <colyli@suse.de>
Cc: linux-nvdimm@lists.01.org, dm-devel@redhat.com,
Adrian Huang <ahuang12@lenovo.com>, Jan Kara <jack@suse.com>,
Pankaj Gupta <pankaj.gupta.linux@gmail.com>
Subject: Re: [PATCH v2] dax: fix for do not print error message for non-persistent memory block device
Date: Thu, 3 Sep 2020 12:00:05 -0400 [thread overview]
Message-ID: <20200903160005.GA11871@redhat.com> (raw)
In-Reply-To: <20200903152839.19040-1-colyli@suse.de>
On Thu, Sep 03 2020 at 11:28am -0400,
Coly Li <colyli@suse.de> wrote:
> 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)) {
Don't think I've ever seen a one-liner fix document the diff in its
patch header. Really no need for that.
> Fixes: c2affe920b0e ("dax: do not print error message for non-persistent memory block device")
> Signed-off-by: Coly Li <colyli@suse.de>
> Reviewed-and-Tested-by: Adrian Huang <ahuang12@lenovo.com>
> Cc: Ira Weiny <ira.weiny@intel.com>
> Cc: Jan Kara <jack@suse.com>
> Cc: Mike Snitzer <snitzer@redhat.com>
> Cc: Pankaj Gupta <pankaj.gupta.linux@gmail.com>
> Cc: Vishal Verma <vishal.l.verma@intel.com>
Thanks for fixing this,
Reviewed-by: Mike Snitzer <snitzer@redhat.com>
> ---
> Changelog:
> v2: add Reviewed-and-Tested-by from Adrian Huang.
> v1: initial version.
>
> 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;
> --
> 2.26.2
>
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org
next prev parent reply other threads:[~2020-09-03 16:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-03 15:28 [PATCH v2] dax: fix for do not print error message for non-persistent memory block device Coly Li
2020-09-03 15:28 ` Coly Li
2020-09-03 15:58 ` Pankaj Gupta
2020-09-03 15:58 ` Pankaj Gupta
2020-09-03 16:00 ` Mike Snitzer [this message]
2020-09-03 16:00 ` Mike Snitzer
2020-09-03 16:14 ` Coly Li
2020-09-03 16:14 ` 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:
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=20200903160005.GA11871@redhat.com \
--to=snitzer@redhat.com \
--cc=ahuang12@lenovo.com \
--cc=colyli@suse.de \
--cc=dm-devel@redhat.com \
--cc=ira.weiny@intel.com \
--cc=jack@suse.com \
--cc=linux-nvdimm@lists.01.org \
--cc=pankaj.gupta.linux@gmail.com \
--cc=vishal.l.verma@intel.com \
/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.