Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp696792ybi; Fri, 21 Jun 2019 06:41:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqw/4+0tQhu6VfIIYE4rlIcROICDZmOneRDlfAWG3JfROTtzL08GS10XOnsTdROEgHBiqXJU X-Received: by 2002:a17:90a:2525:: with SMTP id j34mr6990778pje.11.1561124507115; Fri, 21 Jun 2019 06:41:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561124507; cv=none; d=google.com; s=arc-20160816; b=NFs6XRG7OGN6WW91ybgt7sabe4M5EQUo72MZkTMoqoXKiGi7duFwrlFk85YpsBlQSu e+Lv5Q3w00uWlEILptk8u1ARLdLkiTito8D2ghgoe82As8xPYCApZ3SbPcbRtzfx3jxR YUkfl1tSDsh/bMuixeypgHuJLhSAITSKlgNLRdxGZoGylH5YGQDDcDrmTDTeYj4q4ZgL DfWEELVoKglwHg7bNTKFtH8gvX6Em6nD26uSDdqggh6iEg0DZ6iTq1xIeY/iIEeQqQPX dOuYsiDheyEhROGh7xMteOld5jY23WQhYqgI9kq3AnrX4ebXHxO/1vSX/9Zar43VQzmI Wm5g== 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=b+8E0Muh8/dGv4BkxruCo3wulU5bGuc6INwoqoKe9zo=; b=AbUjke7Fyyz634BAM+qppEbU8KjUW6ZgJscbr4TS3VEFD51DoEweIdZgkBx7GhK0k5 4zAGl42/j6U34BmticLvGj9hDv8abDaKLcY5jr6u049M7trWd4CAic00x0FP1YYAmrqK ancHyS3uqjAtI7GiWD2VTU5luiv6nNyGZf0rScB4UslZdyJseAnG6zABK1hn/N8mvLm2 pIG18yeaz7IGbEAVdWESOwgE5u6RYDN18jEhzEzEaYW3TjfzWx/XPtH0KtoPfoa9AvVK GTfhIPbaDxIv//U4Vufoipb6aUnUq7zzxG3di2o1ytq8tq5J8oG7ZgL7hNxAgWfvBtq3 5zOw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 n185si2712299pfn.16.2019.06.21.06.41.32; Fri, 21 Jun 2019 06:41:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1726340AbfFUNlG (ORCPT + 99 others); Fri, 21 Jun 2019 09:41:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24053 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726010AbfFUNlG (ORCPT ); Fri, 21 Jun 2019 09:41:06 -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 D5C503086208; Fri, 21 Jun 2019 13:41:05 +0000 (UTC) Received: from dhcp201-121.englab.pnq.redhat.com (ovpn-116-60.sin2.redhat.com [10.67.116.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id CC28D5B690; Fri, 21 Jun 2019 13:40:27 +0000 (UTC) From: Pankaj Gupta To: dm-devel@redhat.com, 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, pagupta@redhat.com, pbonzini@redhat.com, yuval.shaia@oracle.com, kilobyte@angband.pl, jstaron@google.com, rdunlap@infradead.org, snitzer@redhat.com Subject: [PATCH v14 7/7] xfs: disable map_sync for async flush Date: Fri, 21 Jun 2019 19:04:55 +0530 Message-Id: <20190621133455.3303-8-pagupta@redhat.com> In-Reply-To: <20190621133455.3303-1-pagupta@redhat.com> References: <20190621133455.3303-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]); Fri, 21 Jun 2019 13:41:06 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 Reviewed-by: Darrick J. Wong --- 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