[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aYC-set6OAK9F9GE@casper.infradead.org>
Date: Mon, 2 Feb 2026 15:11:45 +0000
From: Matthew Wilcox <willy@...radead.org>
To: Christoph Hellwig <hch@....de>
Cc: Eric Biggers <ebiggers@...nel.org>, Al Viro <viro@...iv.linux.org.uk>,
Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>,
David Sterba <dsterba@...e.com>, Theodore Ts'o <tytso@....edu>,
Jaegeuk Kim <jaegeuk@...nel.org>, Chao Yu <chao@...nel.org>,
Andrey Albershteyn <aalbersh@...hat.com>,
linux-fsdevel@...r.kernel.org, linux-btrfs@...r.kernel.org,
linux-ext4@...r.kernel.org, linux-f2fs-devel@...ts.sourceforge.net,
fsverity@...ts.linux.dev
Subject: Re: [PATCH 02/11] readahead: push invalidate_lock out of
page_cache_ra_unbounded
On Mon, Feb 02, 2026 at 07:06:31AM +0100, Christoph Hellwig wrote:
> +++ b/fs/f2fs/file.c
> @@ -4418,7 +4418,9 @@ static int redirty_blocks(struct inode *inode, pgoff_t page_idx, int len)
> pgoff_t redirty_idx = page_idx;
> int page_len = 0, ret = 0;
>
> + filemap_invalidate_lock_shared(mapping);
> page_cache_ra_unbounded(&ractl, len, 0);
> + filemap_invalidate_unlock_shared(mapping);
Why is f2fs calling page_cache_ra_unbounded() here? The documentation
literally says not to call it:
* This function is for filesystems to call when they want to start
* readahead beyond a file's stated i_size. This is almost certainly
* not the function you want to call. Use page_cache_async_readahead()
* or page_cache_sync_readahead() instead.
(in this case, f2fs doesn't have a folio, so page_cache_async_ra() is
probably the right function to call). But what's the point in writing
documentation when people don't read it?
> @@ -228,9 +229,10 @@ void page_cache_ra_unbounded(struct readahead_control *ractl,
> */
> unsigned int nofs = memalloc_nofs_save();
>
> + lockdep_assert_held_read(&mapping->invalidate_lock);
Hm, why are we asserting that it's not write-locked? For the
purposes of this function, I'd think we want to just
lockdep_assert_held()?
In the tree I'm looking at, there are also calls to
page_cache_ra_unbounded() in fs/ext4/verity.c and fs/f2fs/verity.c
which probably need the lock taken too?
Powered by blists - more mailing lists