Skip to content

Commit 4c7a22b

Browse files
committed
Merge patch series "fixes for uncached IO"
Two fixes for uncached IO. * patches from https://lore.kernel.org/r/[email protected]: mm/truncate: don't skip dirty page in folio_unmap_invalidate() mm/filemap: fix miscalculated file range for filemap_fdatawrite_range_kick() Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Christian Brauner <[email protected]>
2 parents b4c173d + 9272899 commit 4c7a22b

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

include/linux/fs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2975,8 +2975,8 @@ static inline ssize_t generic_write_sync(struct kiocb *iocb, ssize_t count)
29752975
} else if (iocb->ki_flags & IOCB_DONTCACHE) {
29762976
struct address_space *mapping = iocb->ki_filp->f_mapping;
29772977

2978-
filemap_fdatawrite_range_kick(mapping, iocb->ki_pos,
2979-
iocb->ki_pos + count);
2978+
filemap_fdatawrite_range_kick(mapping, iocb->ki_pos - count,
2979+
iocb->ki_pos - 1);
29802980
}
29812981

29822982
return count;

mm/filemap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ EXPORT_SYMBOL(filemap_fdatawrite_range);
445445
* filemap_fdatawrite_range_kick - start writeback on a range
446446
* @mapping: target address_space
447447
* @start: index to start writeback on
448-
* @end: last (non-inclusive) index for writeback
448+
* @end: last (inclusive) index for writeback
449449
*
450450
* This is a non-integrity writeback helper, to start writing back folios
451451
* for the indicated range.

mm/truncate.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,8 +548,6 @@ int folio_unmap_invalidate(struct address_space *mapping, struct folio *folio,
548548

549549
VM_BUG_ON_FOLIO(!folio_test_locked(folio), folio);
550550

551-
if (folio_test_dirty(folio))
552-
return 0;
553551
if (folio_mapped(folio))
554552
unmap_mapping_folio(folio);
555553
BUG_ON(folio_mapped(folio));

0 commit comments

Comments
 (0)