From: Jane Chu <jane.chu@oracle.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: "david@fromorbit.com" <david@fromorbit.com>,
"djwong@kernel.org" <djwong@kernel.org>,
"dan.j.williams@intel.com" <dan.j.williams@intel.com>,
"vishal.l.verma@intel.com" <vishal.l.verma@intel.com>,
"dave.jiang@intel.com" <dave.jiang@intel.com>,
"agk@redhat.com" <agk@redhat.com>,
"snitzer@redhat.com" <snitzer@redhat.com>,
"dm-devel@redhat.com" <dm-devel@redhat.com>,
"ira.weiny@intel.com" <ira.weiny@intel.com>,
"willy@infradead.org" <willy@infradead.org>,
"vgoyal@redhat.com" <vgoyal@redhat.com>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"nvdimm@lists.linux.dev" <nvdimm@lists.linux.dev>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH v5 4/7] dax: add dax_recovery_write to dax_op and dm target type
Date: Wed, 2 Feb 2022 22:03:12 +0000 [thread overview]
Message-ID: <fba7dc7a-ed09-bb1f-4882-da50fc470c20@oracle.com> (raw)
In-Reply-To: <YfqIgliJi0GkviXD@infradead.org>
On 2/2/2022 5:34 AM, Christoph Hellwig wrote:
> On Fri, Jan 28, 2022 at 02:31:47PM -0700, Jane Chu wrote:
>> dax_recovery_write() dax op is only required for DAX device that
>> export DAXDEV_RECOVERY indicating its capability to recover from
>> poisons.
>>
>> DM may be nested, if part of the base dax devices forming a DM
>> device support dax recovery, the DM device is marked with such
>> capability.
>
> I'd fold this into the previous 2 patches as the flag and method
> are clearly very tightly coupled.
Make sense, will do.
>
>> +static size_t linear_dax_recovery_write(struct dm_target *ti, pgoff_t pgoff,
>> + void *addr, size_t bytes, struct iov_iter *i)
>
> Function line continuations use two tab indentations or alignment after
> the opening brace.
Okay.
>
>> +{
>> + struct dax_device *dax_dev = linear_dax_pgoff(ti, &pgoff);
>> +
>> + if (!dax_recovery_capable(dax_dev))
>> + return (size_t) -EOPNOTSUPP;
>
> Returning a negativ errno through an unsigned argument looks dangerous.
Sorry, should be (ssize_t) there.
>
>> + /* recovery_write: optional operation. */
>
> And explanation of what the method is use for might be more useful than
> mentioning that is is optional.
Will add substance to comments.
>
>> + size_t (*recovery_write)(struct dax_device *, pgoff_t, void *, size_t,
>> + struct iov_iter *);
>
> Spelling out the arguments tends to help readability, but then again
> none of the existing methods does it.
Thanks!
-jane
next prev parent reply other threads:[~2022-02-02 22:03 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-28 21:31 [PATCH v5 0/7] DAX poison recovery Jane Chu
2022-01-28 21:31 ` [PATCH v5 1/7] mce: fix set_mce_nospec to always unmap the whole page Jane Chu
2022-02-02 13:21 ` Christoph Hellwig
2022-02-02 21:20 ` Jane Chu
2022-02-02 23:07 ` Jane Chu
2022-02-03 13:42 ` Christoph Hellwig
2022-02-04 5:23 ` Dan Williams
2022-02-06 8:30 ` Jane Chu
2022-01-28 21:31 ` [PATCH v5 2/7] dax: introduce dax device flag DAXDEV_RECOVERY Jane Chu
2022-02-02 13:23 ` Christoph Hellwig
2022-02-02 21:27 ` Jane Chu
2022-02-03 13:43 ` Christoph Hellwig
2022-02-04 5:17 ` Dan Williams
2022-02-04 5:32 ` Dan Williams
2022-02-06 8:29 ` Jane Chu
2022-01-28 21:31 ` [PATCH v5 3/7] dm: make dm aware of target's DAXDEV_RECOVERY capability Jane Chu
2022-02-04 5:34 ` Dan Williams
2022-02-06 8:27 ` Jane Chu
2022-01-28 21:31 ` [PATCH v5 4/7] dax: add dax_recovery_write to dax_op and dm target type Jane Chu
2022-02-02 13:34 ` Christoph Hellwig
2022-02-02 22:03 ` Jane Chu [this message]
2022-02-04 6:03 ` Dan Williams
2022-02-06 8:25 ` Jane Chu
2022-01-28 21:31 ` [PATCH v5 5/7] pmem: add pmem_recovery_write() dax op Jane Chu
2022-02-02 13:43 ` Christoph Hellwig
2022-02-02 22:13 ` Jane Chu
2022-02-04 6:21 ` Dan Williams
2022-02-06 8:08 ` Jane Chu
2022-01-28 21:31 ` [PATCH v5 6/7] dax: add recovery_write to dax_iomap_iter in failure path Jane Chu
2022-02-02 13:44 ` Christoph Hellwig
2022-02-02 22:18 ` Jane Chu
2022-01-28 21:31 ` [PATCH v5 7/7] pmem: fix pmem_do_write() avoid writing to 'np' page Jane Chu
2022-02-02 13:28 ` Christoph Hellwig
2022-02-02 21:31 ` Jane Chu
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=fba7dc7a-ed09-bb1f-4882-da50fc470c20@oracle.com \
--to=jane.chu@oracle.com \
--cc=agk@redhat.com \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=david@fromorbit.com \
--cc=djwong@kernel.org \
--cc=dm-devel@redhat.com \
--cc=hch@infradead.org \
--cc=ira.weiny@intel.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=nvdimm@lists.linux.dev \
--cc=snitzer@redhat.com \
--cc=vgoyal@redhat.com \
--cc=vishal.l.verma@intel.com \
--cc=willy@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).