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: <f4b32f05-6396-329b-4bc8-18d4af244279@redhat.com>
Date:   Mon, 6 Mar 2023 14:59:08 +0100
From:   David Hildenbrand <david@...hat.com>
To:     Luis Chamberlain <mcgrof@...nel.org>, hughd@...gle.com,
        akpm@...ux-foundation.org, willy@...radead.org, brauner@...nel.org
Cc:     linux-mm@...ck.org, p.raghav@...sung.com, da.gomez@...sung.com,
        a.manzanares@...sung.com, dave@...olabs.net, yosryahmed@...gle.com,
        keescook@...omium.org, patches@...ts.linux.dev,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/6] shmem: remove check for folio lock on writepage()

On 03.03.23 00:27, Luis Chamberlain wrote:
> Matthew notes we should not need to check the folio lock
> on the writepage() callback so remove it. This sanity check
> has been lingering since linux-history days. We remove this
> as we tidy up the writepage() callback to make things a bit
> clearer.
> 
> Suggested-by: Matthew Wilcox <willy@...radead.org>
> Signed-off-by: Luis Chamberlain <mcgrof@...nel.org>
> ---
>   mm/shmem.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/mm/shmem.c b/mm/shmem.c
> index 1af85259b6fc..7fff1a3af092 100644
> --- a/mm/shmem.c
> +++ b/mm/shmem.c
> @@ -1354,7 +1354,6 @@ static int shmem_writepage(struct page *page, struct writeback_control *wbc)
>   		folio_clear_dirty(folio);
>   	}
>   
> -	BUG_ON(!folio_test_locked(folio));
>   	mapping = folio->mapping;
>   	index = folio->index;
>   	inode = mapping->host;


It's still required IIUC. At least for split_huge_page() and 
setting/clearing some page flags in there.

At least split_huge_page() also contains a
	VM_BUG_ON_FOLIO(!folio_test_locked(folio), folio);

So it's probably reasonable to remove this unconditional sanity check 
here; removing BUG_ON's is always nice.

Acked-by: David Hildenbrand <david@...hat.com>

-- 
Thanks,

David / dhildenb

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ