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: <12d08476-6f2c-e411-2999-f0d4a8ad887a@amd.com>
Date:   Sat, 19 Jun 2021 11:14:20 -0500
From:   "Sierra Guiza, Alejandro (Alex)" <alex.sierra@....com>
To:     Dave Chinner <david@...morbit.com>
Cc:     akpm@...ux-foundation.org, Felix.Kuehling@....com,
        linux-mm@...ck.org, rcampbell@...dia.com,
        linux-ext4@...r.kernel.org, linux-xfs@...r.kernel.org,
        amd-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
        hch@....de, jgg@...dia.com, jglisse@...hat.com
Subject: Re: [PATCH v3 1/8] ext4/xfs: add page refcount helper


On 6/17/2021 6:52 PM, Dave Chinner wrote:
> On Thu, Jun 17, 2021 at 10:16:58AM -0500, Alex Sierra wrote:
>> From: Ralph Campbell <rcampbell@...dia.com>
>>
>> There are several places where ZONE_DEVICE struct pages assume a reference
>> count == 1 means the page is idle and free. Instead of open coding this,
>> add a helper function to hide this detail.
>>
>> v2:
>> [AS]: rename dax_layout_is_idle_page func to dax_page_unused
> Did you even compile test this?
Thanks for catching this Dave, my mistake, I was building without 
CONFIG_FS_DAX, as I was using DEVICE_GENERIC only.
I'll send the corrected patch in replay.

Regards,

Alex Sierra

>
>> Signed-off-by: Ralph Campbell <rcampbell@...dia.com>
>> Signed-off-by: Alex Sierra <alex.sierra@....com>
>> ---
>>   fs/dax.c            |  4 ++--
>>   fs/ext4/inode.c     |  5 +----
>>   fs/xfs/xfs_file.c   |  4 +---
>>   include/linux/dax.h | 10 ++++++++++
>>   4 files changed, 14 insertions(+), 9 deletions(-)
>>
>> diff --git a/fs/dax.c b/fs/dax.c
>> index 26d5dcd2d69e..321f4ddc6643 100644
>> --- a/fs/dax.c
>> +++ b/fs/dax.c
>> @@ -358,7 +358,7 @@ static void dax_disassociate_entry(void *entry, struct address_space *mapping,
>>   	for_each_mapped_pfn(entry, pfn) {
>>   		struct page *page = pfn_to_page(pfn);
>>   
>> -		WARN_ON_ONCE(trunc && page_ref_count(page) > 1);
>> +		WARN_ON_ONCE(trunc && !dax_layout_is_idle_page(page));
> Because you still use dax_layout_is_idle_page() here, not
> dax_page_unused()...
>
>>   		WARN_ON_ONCE(page->mapping && page->mapping != mapping);
>>   		page->mapping = NULL;
>>   		page->index = 0;
>> @@ -372,7 +372,7 @@ static struct page *dax_busy_page(void *entry)
>>   	for_each_mapped_pfn(entry, pfn) {
>>   		struct page *page = pfn_to_page(pfn);
>>   
>> -		if (page_ref_count(page) > 1)
>> +		if (!dax_layout_is_idle_page(page))
> Here too.
>
> Cheers,
>
> Dave.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ