lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 2 Feb 2022 22:03:12 +0000
From:   Jane Chu <jane.chu@...cle.com>
To:     Christoph Hellwig <hch@...radead.org>
CC:     "david@...morbit.com" <david@...morbit.com>,
        "djwong@...nel.org" <djwong@...nel.org>,
        "dan.j.williams@...el.com" <dan.j.williams@...el.com>,
        "vishal.l.verma@...el.com" <vishal.l.verma@...el.com>,
        "dave.jiang@...el.com" <dave.jiang@...el.com>,
        "agk@...hat.com" <agk@...hat.com>,
        "snitzer@...hat.com" <snitzer@...hat.com>,
        "dm-devel@...hat.com" <dm-devel@...hat.com>,
        "ira.weiny@...el.com" <ira.weiny@...el.com>,
        "willy@...radead.org" <willy@...radead.org>,
        "vgoyal@...hat.com" <vgoyal@...hat.com>,
        "linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
        "nvdimm@...ts.linux.dev" <nvdimm@...ts.linux.dev>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-xfs@...r.kernel.org" <linux-xfs@...r.kernel.org>
Subject: Re: [PATCH v5 4/7] dax: add dax_recovery_write to dax_op and dm
 target type

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ