Skip to content

Commit ab7362d

Browse files
dhowellstorvalds
authored andcommitted
cifs: Fix cifs_writepages_region()
Fix the cifs_writepages_region() to just jump over members of the batch that have been cleaned up rather than counting them as skipped. Unlike the other "skip_write" cases, this situation happens even for WB_SYNC_ALL, simply because the page has either been cleaned by somebody else, or was truncated. So in this case we're not "skipping" the write, we simply no longer need any write at all, so it's very different from the other skip_write cases. And we definitely shouldn't stop writing the rest just because of too many of these cases (or because we want to be rescheduled). Fixes: 3822a7c ("Merge tag 'mm-stable-2023-02-20-13-37' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm") Signed-off-by: David Howells <[email protected]> Link: https://lore.kernel.org/lkml/[email protected]/ Signed-off-by: Linus Torvalds <[email protected]>
1 parent d2980d8 commit ab7362d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/cifs/file.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2893,8 +2893,9 @@ static int cifs_writepages_region(struct address_space *mapping,
28932893

28942894
if (folio_mapping(folio) != mapping ||
28952895
!folio_test_dirty(folio)) {
2896+
start += folio_size(folio);
28962897
folio_unlock(folio);
2897-
goto skip_write;
2898+
continue;
28982899
}
28992900

29002901
if (folio_test_writeback(folio) ||

0 commit comments

Comments
 (0)