From: Ira Weiny <ira.weiny@intel.com>
To: Dave Jiang <dave.jiang@intel.com>, <nvdimm@lists.linux.dev>,
<linux-cxl@vger.kernel.org>
Cc: <dan.j.williams@intel.com>, <vishal.l.verma@intel.com>,
<ira.weiny@intel.com>
Subject: Re: [PATCH] dax: Add direct_access() callback check for dax_direct_access()
Date: Mon, 9 Mar 2026 11:58:45 -0500 [thread overview]
Message-ID: <69aefc453438e_1954ee10015@iweiny-mobl.notmuch> (raw)
In-Reply-To: <20260306230507.2149965-1-dave.jiang@intel.com>
Dave Jiang wrote:
> __devm_create_dev_dax() calls alloc_dax() with the ops parameter passed
> in as NULL. Therefore the ops pointer in dev_dax can be NULL. Add a
> check in dax_direct_access() for ops and ops->direct_access() before
> calling ops->direct_access().
Doesn't this need checking in dax_zero_page_range() and
dax_recovery_write() as well?
Ira
>
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
> ---
> drivers/dax/super.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/dax/super.c b/drivers/dax/super.c
> index c00b9dff4a06..5cebaf11a58e 100644
> --- a/drivers/dax/super.c
> +++ b/drivers/dax/super.c
> @@ -160,6 +160,9 @@ long dax_direct_access(struct dax_device *dax_dev, pgoff_t pgoff, long nr_pages,
> if (nr_pages < 0)
> return -EINVAL;
>
> + if (!dax_dev->ops || !dax_dev->ops->direct_access)
> + return -EOPNOTSUPP;
> +
> avail = dax_dev->ops->direct_access(dax_dev, pgoff, nr_pages,
> mode, kaddr, pfn);
> if (!avail)
>
> base-commit: 11439c4635edd669ae435eec308f4ab8a0804808
> --
> 2.53.0
>
>
prev parent reply other threads:[~2026-03-09 16:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-06 23:05 [PATCH] dax: Add direct_access() callback check for dax_direct_access() Dave Jiang
2026-03-09 16:58 ` Ira Weiny [this message]
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=69aefc453438e_1954ee10015@iweiny-mobl.notmuch \
--to=ira.weiny@intel.com \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=linux-cxl@vger.kernel.org \
--cc=nvdimm@lists.linux.dev \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox