From nobody Thu May 2 17:47:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1510907165271434.829016702858; Fri, 17 Nov 2017 00:26:05 -0800 (PST) Received: from localhost ([::1]:44426 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFbyG-0002iR-HH for importer@patchew.org; Fri, 17 Nov 2017 03:25:56 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFbxX-0002PB-5s for qemu-devel@nongnu.org; Fri, 17 Nov 2017 03:25:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFbxU-0000NB-1l for qemu-devel@nongnu.org; Fri, 17 Nov 2017 03:25:11 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:2792) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1eFbxT-0000Io-Ej for qemu-devel@nongnu.org; Fri, 17 Nov 2017 03:25:07 -0500 Received: from 172.30.72.58 (EHLO DGGEMS404-HUB.china.huawei.com) ([172.30.72.58]) by dggrg04-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DLA12679; Fri, 17 Nov 2017 16:24:50 +0800 (CST) Received: from [127.0.0.1] (10.177.16.168) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.361.1; Fri, 17 Nov 2017 16:23:45 +0800 To: , , From: jiangyiwen Message-ID: <5A0E9C91.4050108@huawei.com> Date: Fri, 17 Nov 2017 16:23:45 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.177.16.168] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A0B0205.5A0E9CD3.000E, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 3415b9fd0e88b6d31a152ee8664f9c0c X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-Received-From: 45.249.212.190 Subject: [Qemu-devel] [PATCH] Don't ignore O_DIRECT flag in the 9pfs server X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduard.Shishkin@huawei.com, sochin.jiang@huawei.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 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 --- hw/9pfs/9p.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 52d4663..5ea01c4 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -155,10 +155,6 @@ static int get_dotl_openflags(V9fsState *s, int oflags) */ flags =3D dotl_to_open_flags(oflags); flags &=3D ~(O_NOCTTY | O_ASYNC | O_CREAT); - /* - * Ignore direct disk access hint until the server supports it. - */ - flags &=3D ~O_DIRECT; return flags; } --=20 1.8.3.1