Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp231629yba; Thu, 25 Apr 2019 22:06:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqyOv+JNiIOGdwZTzLVa3K5OuefhmkcaUYiH1Zxn4cTubS/74IlDgjeETWxyp3ukYKcKW/Oe X-Received: by 2002:a65:50c2:: with SMTP id s2mr41927397pgp.112.1556255210875; Thu, 25 Apr 2019 22:06:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556255210; cv=none; d=google.com; s=arc-20160816; b=m9/XClCq1wsgXYgaaew6CVroNWHsYoMT78AfU39NHS+U3NPPEJsw4l4YV5hz9Zgjj3 3DpCkgRKijQu+NQQ3RpOaBdsllh6QN6a9DOWTD9jGXhl0jcnndI3gw1TAUrMrHpjvj2c +jGLqZRbsUiwG9kpEutyoqdrWRgvWEOOqq1vgnldJ+QeIP6/dKl3jqH6IMVfGk7a1WBX I5AaQM1q3tSDhUBBdBswxfUf3l4hsiz/TxxobE+94Gv1cMuKMEb9xKagG8w/5GTgcxBF zVYaCLghsjk4ocD0YJFfcVr8oigI6Pi9aUHLy/xRDM366QpcjuIskTR2d23fEkcm2fTD euRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=njXlIckiKpSBhbmR8jCgbGiIupmBx9/AFH5ITcjpRhc=; b=0YFayZsoVr5MJZ1o6M1KnvPhimV5l8fDZtM67jsouZf3Qk2QWPKRw9xcmDFzjy5JI9 M4jaDVMw0wW3rw3olyCtKVVo9jWjgHtFGcVjrlRdg7ohniuOYYCioLSYF7S/eLT7cd3k lWZzcJIaGB9GM7O/TFPMmw7OcXVCFzG/L7BN2uLMRNDZIgF2UCbfx2vkm2SmiHB72ZAA wOqSQqihIaWHYyVuu7r3qZ/vNNUtGdHLXSk1MOzpYeeTl34sFMA2rs7tpzvzlb9Up1mi xgyJWsyT2I+xbykELgIdo47bjwiNaKxI03LtPZVWuZBsuYrGt14EorIN5vaeRgpWwXhn e5qQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k123si24329111pfc.285.2019.04.25.22.06.36; Thu, 25 Apr 2019 22:06:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729141AbfDZFDL (ORCPT + 99 others); Fri, 26 Apr 2019 01:03:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39170 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725950AbfDZFDL (ORCPT ); Fri, 26 Apr 2019 01:03:11 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B77F630ADBB4; Fri, 26 Apr 2019 05:03:10 +0000 (UTC) Received: from dhcp201-121.englab.pnq.redhat.com (unknown [10.65.16.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id ACD3960856; Fri, 26 Apr 2019 05:02:51 +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 Cc: dan.j.williams@intel.com, zwisler@kernel.org, vishal.l.verma@intel.com, dave.jiang@intel.com, mst@redhat.com, jasowang@redhat.com, willy@infradead.org, rjw@rjwysocki.net, hch@infradead.org, lenb@kernel.org, jack@suse.cz, tytso@mit.edu, adilger.kernel@dilger.ca, darrick.wong@oracle.com, lcapitulino@redhat.com, kwolf@redhat.com, imammedo@redhat.com, jmoyer@redhat.com, nilal@redhat.com, riel@surriel.com, stefanha@redhat.com, aarcange@redhat.com, david@redhat.com, david@fromorbit.com, cohuck@redhat.com, xiaoguangrong.eric@gmail.com, pbonzini@redhat.com, kilobyte@angband.pl, yuval.shaia@oracle.com, pagupta@redhat.com Subject: [PATCH v7 6/6] xfs: disable map_sync for async flush Date: Fri, 26 Apr 2019 10:30:39 +0530 Message-Id: <20190426050039.17460-7-pagupta@redhat.com> In-Reply-To: <20190426050039.17460-1-pagupta@redhat.com> References: <20190426050039.17460-1-pagupta@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Fri, 26 Apr 2019 05:03:11 +0000 (UTC) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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 xfs. Signed-off-by: Pankaj Gupta --- fs/xfs/xfs_file.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index a7ceae90110e..f17652cca5ff 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c @@ -1203,11 +1203,14 @@ xfs_file_mmap( struct file *filp, struct vm_area_struct *vma) { + struct dax_device *dax_dev; + + dax_dev = xfs_find_daxdev_for_inode(file_inode(filp)); /* - * 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(filp)) && (vma->vm_flags & VM_SYNC)) + if (!daxdev_mapping_supported(vma, dax_dev)) return -EOPNOTSUPP; file_accessed(filp); -- 2.20.1