Skip to content

Commit 8b26c8c

Browse files
Lizhi Xuaalexandrovich
authored andcommitted
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: b432163 ("fs/ntfs3: Update inode->i_mapping->a_ops on compression state") Reported-by: [email protected] Closes: https://syzkaller.appspot.com/bug?extid=e36cc3297bd3afd25e19 Signed-off-by: Lizhi Xu <[email protected]> Signed-off-by: Konstantin Komarov <[email protected]>
1 parent af5cab0 commit 8b26c8c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

fs/ntfs3/inode.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,10 @@ static ssize_t ntfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
805805
ret = 0;
806806
goto out;
807807
}
808+
if (is_compressed(ni)) {
809+
ret = 0;
810+
goto out;
811+
}
808812

809813
ret = blockdev_direct_IO(iocb, inode, iter,
810814
wr ? ntfs_get_block_direct_IO_W :
@@ -2068,5 +2072,6 @@ const struct address_space_operations ntfs_aops_cmpr = {
20682072
.read_folio = ntfs_read_folio,
20692073
.readahead = ntfs_readahead,
20702074
.dirty_folio = block_dirty_folio,
2075+
.direct_IO = ntfs_direct_IO,
20712076
};
20722077
// clang-format on

0 commit comments

Comments
 (0)