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] [day] [month] [year] [list]
Date:   Mon, 6 Feb 2023 14:45:53 +0800
From:   Shiyang Ruan <ruansy.fnst@...itsu.com>
To:     Matthew Wilcox <willy@...radead.org>
CC:     <linux-kernel@...r.kernel.org>, <linux-xfs@...r.kernel.org>,
        <nvdimm@...ts.linux.dev>, <linux-mm@...ck.org>,
        <linux-fsdevel@...r.kernel.org>, <djwong@...nel.org>,
        <dan.j.williams@...el.com>, <david@...morbit.com>,
        <hch@...radead.org>, <jane.chu@...cle.com>
Subject: Re: [PATCH v9 1/3] xfs: fix the calculation of length and end



在 2023/2/5 19:42, Matthew Wilcox 写道:
> On Sat, Feb 04, 2023 at 02:58:36PM +0000, Shiyang Ruan wrote:
>> @@ -222,8 +222,8 @@ xfs_dax_notify_failure(
>>   		len -= ddev_start - offset;
>>   		offset = 0;
>>   	}
>> -	if (offset + len > ddev_end)
>> -		len -= ddev_end - offset;
>> +	if (offset + len - 1 > ddev_end)
>> +		len -= offset + len - 1 - ddev_end;
> 
> This _looks_ wrong.  Are you sure it shouldn't be:
> 
> 		len = ddev_end - offset + 1;
> 

It is to make sure the range won't beyond the end of device.

But actually, both of us are rgiht.
   Mine: len -= offset + len - 1 - ddev_end;
      => len = len - (offset + len - 1 - ddev_end);
      => len = len - offset - len + 1 + ddev_end;
      => len = ddev_end - offset + 1;          --> Yours

I forgot to simplify it.  Will fix.


--
Thanks,
Ruan.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ