Skip to content

Commit 1c47c57

Browse files
Matthew Wilcox (Oracle)akpm00
authored andcommitted
mm: fix assertion in folio_end_read()
We only need to assert that the uptodate flag is clear if we're going to set it. This hasn't been a problem before now because we have only used folio_end_read() when completing with an error, but it's convenient to use it in squashfs if we discover the folio is already uptodate. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Cc: Phillip Lougher <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent bd3d56f commit 1c47c57

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/filemap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1523,7 +1523,7 @@ void folio_end_read(struct folio *folio, bool success)
15231523
/* Must be in bottom byte for x86 to work */
15241524
BUILD_BUG_ON(PG_uptodate > 7);
15251525
VM_BUG_ON_FOLIO(!folio_test_locked(folio), folio);
1526-
VM_BUG_ON_FOLIO(folio_test_uptodate(folio), folio);
1526+
VM_BUG_ON_FOLIO(success && folio_test_uptodate(folio), folio);
15271527

15281528
if (likely(success))
15291529
mask |= 1 << PG_uptodate;

0 commit comments

Comments
 (0)