From nobody Thu Mar 28 09:15:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557846120; cv=none; d=zoho.com; s=zohoarc; b=TL0D57qvcvdTrCP5tO056hMYhMAgK+mngMPyFpMzUsacLk1NeL98sMpfOOo6aF/5Bhe2OjDW5coJuxYta2mQhEa/orxDJ+tIQof5oDYZ/9QwEXk54XypBnLCq1Eo6G/GwL3GW2c4yTB+iQxC+35JxQumQGqJHWTs8BEjjiRxfj8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557846120; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=68Zy+MzCV8PC/cJJPhDJQ89EjmeWDr1fDBLYx+fbhSA=; b=c9aV9od8xXNZNPJ25/5bR517Vf9krlj0JzCWFXrKCUGfmNWjCYbpqD5ItFUmIroZuvo6K08wa4r8D+5dNHLywAI+L+gGvpFLhXgwDj33q+Byl6uxQGg/1g3L8N87yfXupu0uOhf73/7N/doJIAzkRqVmXpvPlEQ8dkodWHjwge8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557846120568862.4065970269767; Tue, 14 May 2019 08:02:00 -0700 (PDT) Received: from localhost ([127.0.0.1]:49522 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQYwE-0007Om-L5 for importer@patchew.org; Tue, 14 May 2019 11:01:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46390) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQYt1-00059v-Hb for qemu-devel@nongnu.org; Tue, 14 May 2019 10:58:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQYt0-0000U0-IE for qemu-devel@nongnu.org; Tue, 14 May 2019 10:58:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28170) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQYt0-0000Sg-DD for qemu-devel@nongnu.org; Tue, 14 May 2019 10:58:34 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 40F99308623E; Tue, 14 May 2019 14:58:33 +0000 (UTC) Received: from dhcp201-121.englab.pnq.redhat.com (unknown [10.65.16.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id 164E65D71E; Tue, 14 May 2019 14:58:12 +0000 (UTC) From: Pankaj Gupta To: linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, kvm@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-acpi@vger.kernel.org, qemu-devel@nongnu.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org Date: Tue, 14 May 2019 20:24:21 +0530 Message-Id: <20190514145422.16923-7-pagupta@redhat.com> In-Reply-To: <20190514145422.16923-1-pagupta@redhat.com> References: <20190514145422.16923-1-pagupta@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Tue, 14 May 2019 14:58:33 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v9 6/7] ext4: disable map_sync for async flush 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: pagupta@redhat.com, jack@suse.cz, mst@redhat.com, jasowang@redhat.com, david@fromorbit.com, lcapitulino@redhat.com, adilger.kernel@dilger.ca, zwisler@kernel.org, aarcange@redhat.com, dave.jiang@intel.com, jstaron@google.com, darrick.wong@oracle.com, vishal.l.verma@intel.com, david@redhat.com, willy@infradead.org, hch@infradead.org, jmoyer@redhat.com, nilal@redhat.com, lenb@kernel.org, kilobyte@angband.pl, riel@surriel.com, yuval.shaia@oracle.com, stefanha@redhat.com, pbonzini@redhat.com, dan.j.williams@intel.com, kwolf@redhat.com, tytso@mit.edu, xiaoguangrong.eric@gmail.com, cohuck@redhat.com, rjw@rjwysocki.net, imammedo@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Dont support 'MAP_SYNC' with non-DAX files and DAX files with asynchronous dax_device. Virtio pmem provides asynchronous host page cache flush mechanism. We don't support 'MAP_SYNC' with virtio pmem and ext4. Signed-off-by: Pankaj Gupta Reviewed-by: Jan Kara --- fs/ext4/file.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fs/ext4/file.c b/fs/ext4/file.c index 98ec11f69cd4..dee549339e13 100644 --- a/fs/ext4/file.c +++ b/fs/ext4/file.c @@ -360,15 +360,17 @@ static const struct vm_operations_struct ext4_file_vm= _ops =3D { static int ext4_file_mmap(struct file *file, struct vm_area_struct *vma) { struct inode *inode =3D file->f_mapping->host; + struct ext4_sb_info *sbi =3D EXT4_SB(inode->i_sb); + struct dax_device *dax_dev =3D sbi->s_daxdev; =20 - if (unlikely(ext4_forced_shutdown(EXT4_SB(inode->i_sb)))) + if (unlikely(ext4_forced_shutdown(sbi))) return -EIO; =20 /* - * We don't support synchronous mappings for non-DAX files. At least - * until someone comes with a sensible use case. + * We don't support synchronous mappings for non-DAX files and + * for DAX files if underneath dax_device is not synchronous. */ - if (!IS_DAX(file_inode(file)) && (vma->vm_flags & VM_SYNC)) + if (!daxdev_mapping_supported(vma, dax_dev)) return -EOPNOTSUPP; =20 file_accessed(file); --=20 2.20.1