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.

fs/ntfs3: zero-fill folios beyond i_valid in ntfs_read_folio()

Handle ntfs_read_folio() early when the folio offset is beyond i_valid
by zero-filling the folio and marking it uptodate. This avoids needless
I/O and locking, improves read performance.

Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>

+13
+13
fs/ntfs3/inode.c
··· 723 723 struct address_space *mapping = folio->mapping; 724 724 struct inode *inode = mapping->host; 725 725 struct ntfs_inode *ni = ntfs_i(inode); 726 + loff_t vbo = folio_pos(folio); 727 + 728 + if (unlikely(is_bad_ni(ni))) { 729 + folio_unlock(folio); 730 + return -EIO; 731 + } 732 + 733 + if (ni->i_valid <= vbo) { 734 + folio_zero_range(folio, 0, folio_size(folio)); 735 + folio_mark_uptodate(folio); 736 + folio_unlock(folio); 737 + return 0; 738 + } 726 739 727 740 if (is_resident(ni)) { 728 741 ni_lock(ni);