Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2277887yba; Fri, 10 May 2019 08:57:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpEvZL78wnT599qyqsy+GoiMmxrLjHDoPVkK0MDDd525xFd1TuH8V7VVK03C+msnG6UcOt X-Received: by 2002:a17:902:6b44:: with SMTP id g4mr13993547plt.157.1557503840823; Fri, 10 May 2019 08:57:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557503840; cv=none; d=google.com; s=arc-20160816; b=uxjBIL3+wvJ/hGwQKPWsAytlesHtRrMLLTxsUTtw+nFcsyrKTZcv6/tilZQ3GLdaJu zeh3InQF/hoq6e74z84rc4W2sNk//mcHBB2b1U0BFnIEvyfDi+7fVq9Wke6+aarXtLKl YqpjiDmgE8zJywFVNI5xFed2b1DsfxjfD5tDh8tDmrs5Oj6CSsDMbSLs8wqMj3Qm3fxZ sf1tBmtsMJm1CuBUvNDZGI0JG4iM3XXpQVWUctjAJM2j4IYrEjZmBOc45o6nE5m7DcFO nQDK3jjlbwj0vvjdIdB5ZSBCbGbiDnEHUb8RotmlhEiT6nkQbTQQ3wBbIKWU7N3Ueqhr 3RXA== 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=yfapVjXeMm6PIXRInXRK4yhz375OFCOIdVT7R/BlHFbbfZ/bffc5TnF3L6k1Ecy/0m ijC0Q8ztacDyj4rCJ/GfqxmLUMy6DR2FvbTf900hiGyfDvgr4rowfKzK1d6hVWgd4Jpl 6uRgHo4Yo/q7Cl/BdsljY9HlWxVloG2b/+Vnb6l+RuXDHTzomo397J0nSRx1poJlZH4e Ki5ZVPzblHHCeTzpMVyZtNm5/b0l+oXJflgQK6+zn83zrdIINpV/M2BWhDgRx3UE2yN/ WhYAEmyR5jKaaSXmxITBp1yPugARihQFqMY2R8eE1qnkb2o7idI0E7LLK+8jLvJNm2rW 8tKQ== 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 q3si8506456pgg.407.2019.05.10.08.57.06; Fri, 10 May 2019 08:57:20 -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 S1727824AbfEJPzS (ORCPT + 99 others); Fri, 10 May 2019 11:55:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56452 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727346AbfEJPzR (ORCPT ); Fri, 10 May 2019 11:55:17 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 38D3D4E93D; Fri, 10 May 2019 15:55:17 +0000 (UTC) Received: from dhcp201-121.englab.pnq.redhat.com (unknown [10.65.16.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id DB1A660BFB; Fri, 10 May 2019 15:54:53 +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, jstaron@google.com, pagupta@redhat.com Subject: [PATCH v8 6/6] xfs: disable map_sync for async flush Date: Fri, 10 May 2019 21:22:02 +0530 Message-Id: <20190510155202.14737-7-pagupta@redhat.com> In-Reply-To: <20190510155202.14737-1-pagupta@redhat.com> References: <20190510155202.14737-1-pagupta@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 10 May 2019 15:55:17 +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 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