@samitouri / QOSamiQemu / commits / 8599559580

fuse: Set direct_io and parallel_direct_writes

In fuse_open(), set these flags: - direct_io: We probably actually don't want to have the host page cache be used for our exports. QEMU block exports are supposed to represent the image as-is (and thus potentially changing). This causes a change in iotest 308's reference output. - parallel_direct_writes: We can (now) cope with parallel writes, so we should set this flag. For some reason, it doesn't seem to make an actual performance difference with libfuse, but it does make a difference without it, so let's set it. (See "fuse: Copy write buffer content before polling" for further discussion.) Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Hanna Czenczek <hreitz@redhat.com> Message-ID: <20260309150856.26800-9-hreitz@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>

Hanna Czenczek committed Mar 9, 2026 at 16:08 UTC 859955958013a7e15625b5f86c2427033bfb62f1
2 files changed +3 -1
block/export/fuse.c
+2
@@ -582,6 +582,8 @@ static void fuse_setattr(fuse_req_t req, fuse_ino_t inode, struct stat *statbuf,
582 static void fuse_open(fuse_req_t req, fuse_ino_t inode,
583 struct fuse_file_info *fi)
584 {
585 + fi->direct_io = true;
586 + fi->parallel_direct_writes = true;
587 fuse_reply_open(req, fi);
588 }
589
tests/qemu-iotests/308.out
+1 -1
@@ -131,7 +131,7 @@ wrote 65536/65536 bytes at offset 1048576
131
132 --- Try growing non-growable export ---
133 (OK: Lengths of export and original are the same)
134 -dd: error writing 'TEST_DIR/t.IMGFMT.fuse': Input/output error
134 +dd: error writing 'TEST_DIR/t.IMGFMT.fuse': No space left on device
135 1+0 records in
136 0+0 records out
137