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

fs/ntfs3: Add missing direct_IO in ntfs_aops_cmpr

The ntfs3 can use the page cache directly, so its address_space_operations
need direct_IO. Exit ntfs_direct_IO() if it is a compressed file.

Fixes: b432163ebd15 ("fs/ntfs3: Update inode->i_mapping->a_ops on compression state")
Reported-by: syzbot+e36cc3297bd3afd25e19@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=e36cc3297bd3afd25e19
Signed-off-by: Lizhi Xu <lizhi.xu@windriver.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>

authored by

Lizhi Xu and committed by
Konstantin Komarov
8b26c8c3 af5cab0e

+5
+5
fs/ntfs3/inode.c
··· 805 805 ret = 0; 806 806 goto out; 807 807 } 808 + if (is_compressed(ni)) { 809 + ret = 0; 810 + goto out; 811 + } 808 812 809 813 ret = blockdev_direct_IO(iocb, inode, iter, 810 814 wr ? ntfs_get_block_direct_IO_W : ··· 2072 2068 .read_folio = ntfs_read_folio, 2073 2069 .readahead = ntfs_readahead, 2074 2070 .dirty_folio = block_dirty_folio, 2071 + .direct_IO = ntfs_direct_IO, 2075 2072 }; 2076 2073 // clang-format on