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]
Message-ID: <361498b3-e83f-a82c-b1e8-e44720d16fdd@samsung.com>
Date:   Wed, 20 Sep 2023 10:06:19 +0200
From:   Pankaj Raghav <p.raghav@...sung.com>
To:     Matthew Wilcox <willy@...radead.org>,
        Pankaj Raghav <kernel@...kajraghav.com>
CC:     <linux-xfs@...r.kernel.org>, <linux-fsdevel@...r.kernel.org>,
        <david@...morbit.com>, <da.gomez@...sung.com>,
        <akpm@...ux-foundation.org>, <linux-kernel@...r.kernel.org>,
        <djwong@...nel.org>, <linux-mm@...ck.org>,
        <chandan.babu@...cle.com>, <mcgrof@...nel.org>,
        <gost.dev@...sung.com>
Subject: Re: [RFC 03/23] filemap: add folio with at least mapping_min_order
 in __filemap_get_folio

On 2023-09-15 21:00, Matthew Wilcox wrote:
> On Fri, Sep 15, 2023 at 08:38:28PM +0200, Pankaj Raghav wrote:
>> +++ b/mm/filemap.c
>> @@ -1862,6 +1862,10 @@ struct folio *__filemap_get_folio(struct address_space *mapping, pgoff_t index,
>>  		fgf_t fgp_flags, gfp_t gfp)
>>  {
>>  	struct folio *folio;
>> +	int min_order = mapping_min_folio_order(mapping);
>> +	int nr_of_pages = (1U << min_order);
>> +
>> +	index = round_down(index, nr_of_pages);
>>  
>>  repeat:
>>  	folio = filemap_get_entry(mapping, index);
>> @@ -1929,8 +1933,14 @@ struct folio *__filemap_get_folio(struct address_space *mapping, pgoff_t index,
>>  			err = -ENOMEM;
>>  			if (order == 1)
>>  				order = 0;
>> +			if (order < min_order)
>> +				order = min_order;
> 
> ... oh, you do something similar here to what I recommend in my previous
> response.  I don't understand why you need the previous patch.
> 

Hmm, we made changes here a bit later and that is why it is a duplicated
I guess in both iomap fgf order and clamping the order here to min_order. We could
remove the previous patch and retain this one here.

>> +			if (min_order)
>> +				VM_BUG_ON(index & ((1UL << order) - 1));
> 
> You don't need the 'if' here; index & ((1 << 0) - 1) becomes false.
> 

Sounds good!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ