Don't ignore O_DIRECT flag in the 9pfs server
PATCH 1/1 Don't ignore O_DIRECT flag in the 9pfs server
Now v9fs in linux has already supported O_DIRECT(v9fs_direct_IO), when guest user open file with O_DIRECT flag and return success, so user hopes data doesn't pass through page cache, but 9pfs in qemu ignore direct disk access and use host page cache, it is not match to DIRECT_IO semantic, so we should not ignore O_DIRECT in 9pfs unless v9fs in linux don't support DIRECT_IO.
And if server fs don't support O_DIRECT, user will receive -EINVAL and know the filesystem don't support O_DIRECT.
So in order to ensure semantic consistency, don't ignore direct disk access in 9pfs.
Signed-off-by Yiwen Jiang <[email protected]>
--- hw/9pfs/9p.c | 4 ---- 1 file changed, 4 deletions(-)
hw/9pfs/9p.c +0 -4
@@ -155,10 +155,6 @@ static int get_dotl_openflags(V9fsState *s, int oflags)*/ flags =dotl_to_open_flags (oflags); flags &= ~(O_NOCTTY |O_ASYNC |O_CREAT ); -/* -* Ignore direct disk access hint until the server supports it. -*/ - flags &= ~O_DIRECT ;return flags; }
Signature · 1 line
1.8.3.1