[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aJ8m42sM1NX_wEE9@casper.infradead.org>
Date: Fri, 15 Aug 2025 13:24:03 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Kairui Song <kasong@...cent.com>
Cc: linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/page-writeback: drop usage of folio_index
On Fri, Aug 15, 2025 at 08:12:52PM +0800, Kairui Song wrote:
> +++ b/mm/page-writeback.c
> @@ -2739,8 +2739,8 @@ void __folio_mark_dirty(struct folio *folio, struct address_space *mapping,
> if (folio->mapping) { /* Race with truncate? */
> WARN_ON_ONCE(warn && !folio_test_uptodate(folio));
> folio_account_dirtied(folio, mapping);
> - __xa_set_mark(&mapping->i_pages, folio_index(folio),
> - PAGECACHE_TAG_DIRTY);
> + __xa_set_mark(&mapping->i_pages, folio->index,
> + PAGECACHE_TAG_DIRTY);
> }
> xa_unlock_irqrestore(&mapping->i_pages, flags);
> }
What about a shmem folio that's been moved to the swap cache? I used
folio_index() here because I couldn't prove to my satisfaction that this
couldn't happen.
Powered by blists - more mailing lists