Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4502215yba; Tue, 9 Apr 2019 21:44:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqz+Tc8RDihr2EbXxP2d7HwXAKntZiZAkBqP+lMiFjlJH1VPI0Imy3sYrCT6mW71SvkGQ6hJ X-Received: by 2002:a63:6942:: with SMTP id e63mr39277787pgc.102.1554871477268; Tue, 09 Apr 2019 21:44:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554871477; cv=none; d=google.com; s=arc-20160816; b=gUFqt0I0c1dOS+aH36xt81V8opkpg2+pUimpixDr2wS+Q/xVKvk6/+kcKx/k4J/b93 so5xwLrpMl6xfJJuQfFHcuIKtS10zVB88iyUCoK3F7jHfMY4e6K9Yz24OQw/dCg9tFP+ vqRKTTq52vHnHItREH94MFY/xa3WxahscJTa9DZho6yyenDyZQwDHMUkeXEMP7jByL4b JIqeGlTXQY04z75NdjWXAmEoFgOBediuEleCeR2Sa/WO4oQOzKm3XFHPhKJ97Rddl/9W S7tcg8STN/EDKIYf1EGvcvTgB7KPW2aLZ2Tk7IzBybyLm/0HxlaQsZEv/cxy0JBKcivf 8vgA== 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=uDrSofO2njDoa+GqoVWApbR01eaf8c25NnxB4yCJTkg=; b=MsRzV3BkrVe9lJADHM9Yy1G6TbDXQap6vPYGZ/HpDZR9qihTHFNGsa55Mz3u6h29HH xW7RVqttsvDwM93mD7nLxuz0r4bJ0On+vftOM+HYnUU8jeZc1SuQX+LfDpvCHd3GK8x7 jlS4cAj35Ad7ZcPaDhX2ceUkQWwIJ6f2qPEua1DzTthkQHaxqQYzpGTmxtCarJ0typWg 0n9zGe0Psm5/PaqRnyCN+hWXrS47LlD/nKn1gAhn+2+jgt8Yq/MSwgU6nDAD7ukpJhva mWta+CRWf8yR7fd5HmxZ9M8715dRU0DBdWtbQbIba+n9JoXQnDe2ssAjST2yKHuiFdii RSzQ== 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 b4si12672183pgg.581.2019.04.09.21.44.09; Tue, 09 Apr 2019 21:44:37 -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 S1727364AbfDJELS (ORCPT + 99 others); Wed, 10 Apr 2019 00:11:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46272 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725924AbfDJELS (ORCPT ); Wed, 10 Apr 2019 00:11:18 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6182C307D98B; Wed, 10 Apr 2019 04:11:17 +0000 (UTC) Received: from dhcp201-121.englab.pnq.redhat.com (dhcp-10-65-161-59.pnq.redhat.com [10.65.161.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id 051AD600D4; Wed, 10 Apr 2019 04:10:55 +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 v5 6/6] xfs: disable map_sync for async flush Date: Wed, 10 Apr 2019 09:38:26 +0530 Message-Id: <20190410040826.24371-7-pagupta@redhat.com> In-Reply-To: <20190410040826.24371-1-pagupta@redhat.com> References: <20190410040826.24371-1-pagupta@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Wed, 10 Apr 2019 04:11:17 +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 --- fs/xfs/xfs_file.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index 1f2e2845eb76..0e59be018511 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c @@ -1196,11 +1196,13 @@ xfs_file_mmap( struct file *filp, struct vm_area_struct *vma) { - /* - * We don't support synchronous mappings for non-DAX files. At least - * until someone comes with a sensible use case. + struct dax_device *dax_dev = xfs_find_daxdev_for_inode + (file_inode(filp)); + + /* 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