[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z7UhllvPUxVuYOqf@dread.disaster.area>
Date: Wed, 19 Feb 2025 11:11:02 +1100
From: Dave Chinner <david@...morbit.com>
To: Jingbo Xu <jefflexu@...ux.alibaba.com>
Cc: axboe@...nel.dk, linux-fsdevel@...r.kernel.org, linux-mm@...ck.org,
brauner@...nel.org, linux-kernel@...r.kernel.org,
viro@...iv.linux.org.uk
Subject: Re: [PATCH 2/2] mm/truncate: don't skip dirty page in
folio_unmap_invalidate()
On Tue, Feb 18, 2025 at 08:02:09PM +0800, Jingbo Xu wrote:
> ... otherwise this is a behavior change for the previous callers of
> invalidate_complete_folio2(), e.g. the page invalidation routine.
>
> Fixes: 4a9e23159fd3 ("mm/truncate: add folio_unmap_invalidate() helper")
> Signed-off-by: Jingbo Xu <jefflexu@...ux.alibaba.com>
> ---
> mm/truncate.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/mm/truncate.c b/mm/truncate.c
> index e2e115adfbc5..76d8fcd89bd0 100644
> --- a/mm/truncate.c
> +++ b/mm/truncate.c
> @@ -548,8 +548,6 @@ int folio_unmap_invalidate(struct address_space *mapping, struct folio *folio,
>
> VM_BUG_ON_FOLIO(!folio_test_locked(folio), folio);
>
> - if (folio_test_dirty(folio))
> - return 0;
Shouldn't that actually return -EBUSY because the folio could not be
invalidated?
Indeed, further down the function the folio gets locked and the
dirty test is repeated. If it fails there it returns -EBUSY....
-Dave.
--
Dave Chinner
david@...morbit.com
Powered by blists - more mailing lists