Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'vfs-6.18-rc1.iomap' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs

Pull vfs iomap updates from Christian Brauner:
"This contains minor fixes and cleanups to the iomap code.

Nothing really stands out here"

* tag 'vfs-6.18-rc1.iomap' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs:
iomap: error out on file IO when there is no inline_data buffer
iomap: trace iomap_zero_iter zeroing activities

+17 -5
+13 -5
fs/iomap/buffered-io.c
··· 304 304 size_t size = i_size_read(iter->inode) - iomap->offset; 305 305 size_t offset = offset_in_folio(folio, iomap->offset); 306 306 307 + if (WARN_ON_ONCE(!iomap->inline_data)) 308 + return -EIO; 309 + 307 310 if (folio_test_uptodate(folio)) 308 311 return 0; 309 312 ··· 897 894 return true; 898 895 } 899 896 900 - static void iomap_write_end_inline(const struct iomap_iter *iter, 897 + static bool iomap_write_end_inline(const struct iomap_iter *iter, 901 898 struct folio *folio, loff_t pos, size_t copied) 902 899 { 903 900 const struct iomap *iomap = &iter->iomap; ··· 906 903 WARN_ON_ONCE(!folio_test_uptodate(folio)); 907 904 BUG_ON(!iomap_inline_data_valid(iomap)); 908 905 906 + if (WARN_ON_ONCE(!iomap->inline_data)) 907 + return false; 908 + 909 909 flush_dcache_folio(folio); 910 910 addr = kmap_local_folio(folio, pos); 911 911 memcpy(iomap_inline_data(iomap, pos), addr, copied); 912 912 kunmap_local(addr); 913 913 914 914 mark_inode_dirty(iter->inode); 915 + return true; 915 916 } 916 917 917 918 /* ··· 928 921 const struct iomap *srcmap = iomap_iter_srcmap(iter); 929 922 loff_t pos = iter->pos; 930 923 931 - if (srcmap->type == IOMAP_INLINE) { 932 - iomap_write_end_inline(iter, folio, pos, copied); 933 - return true; 934 - } 924 + if (srcmap->type == IOMAP_INLINE) 925 + return iomap_write_end_inline(iter, folio, pos, copied); 935 926 936 927 if (srcmap->flags & IOMAP_F_BUFFER_HEAD) { 937 928 size_t bh_written; ··· 1400 1395 1401 1396 /* warn about zeroing folios beyond eof that won't write back */ 1402 1397 WARN_ON_ONCE(folio_pos(folio) > iter->inode->i_size); 1398 + 1399 + trace_iomap_zero_iter(iter->inode, folio_pos(folio) + offset, 1400 + bytes); 1403 1401 1404 1402 folio_zero_range(folio, offset, bytes); 1405 1403 folio_mark_accessed(folio);
+3
fs/iomap/direct-io.c
··· 519 519 loff_t pos = iomi->pos; 520 520 u64 copied; 521 521 522 + if (WARN_ON_ONCE(!inline_data)) 523 + return -EIO; 524 + 522 525 if (WARN_ON_ONCE(!iomap_inline_data_valid(iomap))) 523 526 return -EIO; 524 527
+1
fs/iomap/trace.h
··· 84 84 DEFINE_RANGE_EVENT(iomap_invalidate_folio); 85 85 DEFINE_RANGE_EVENT(iomap_dio_invalidate_fail); 86 86 DEFINE_RANGE_EVENT(iomap_dio_rw_queued); 87 + DEFINE_RANGE_EVENT(iomap_zero_iter); 87 88 88 89 #define IOMAP_TYPE_STRINGS \ 89 90 { IOMAP_HOLE, "HOLE" }, \