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? _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
