]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
fs/ntfs3: force waiting for direct I/O completion
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Fri, 22 May 2026 12:58:12 +0000 (14:58 +0200)
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Tue, 2 Jun 2026 15:02:33 +0000 (17:02 +0200)
It makes ntfs3 wait for direct I/O completion before returning to the
caller, instead of allowing the write path to complete asynchronously.

The issue was discovered during internal tests.

Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
fs/ntfs3/file.c

index 2d1de3739ffea5c4bc42e6554fcc5f9ea4474946..26bec5be248e1f2fb2209b54483945526f71c42d 100644 (file)
@@ -1398,7 +1398,8 @@ static ssize_t ntfs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
                        goto out;
        }
 
-       ret = iomap_dio_rw(iocb, from, &ntfs_iomap_ops, NULL, 0, NULL, 0);
+       ret = iomap_dio_rw(iocb, from, &ntfs_iomap_ops, NULL,
+                          IOMAP_DIO_FORCE_WAIT, NULL, 0);
 
        if (ret == -ENOTBLK) {
                /* Returns -ENOTBLK in case of a page invalidation failure for writes.*/