Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp22065yba; Wed, 3 Apr 2019 03:43:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqxPrHju/HjK3CFi0/LrXbbX5VxTOy3iN8/upwl2w8hUGTCXwasjDbBEng/WgOt1DBwpIqi3 X-Received: by 2002:a62:6985:: with SMTP id e127mr40102545pfc.188.1554288216619; Wed, 03 Apr 2019 03:43:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554288216; cv=none; d=google.com; s=arc-20160816; b=TvhZ/euOE/0NEBQdWqxWCm+qUkG6z6UWO2C3kcbgZYYBXDWwBYJRnr93LXpeP72QAu ODY0C6FDO8+Bz23+QOmz24twfG0RYqTiHWnE6+YBB9Wd/+11r7HSFQ7y1aLgBYaMZWyN KsvJmWM6ofITIqwfE/aVo99o9+ez6681zw+WRQgZjPeaHjd5YlSRguPOnaEVayCTf3W1 Kss/BynC04vyz/NDF33DZqpPZdoOXjejRMqerxSoAv5SSwwIrcilvNlk6Vol26W3RfdK 1Cj8ebKQ5ssbVbj5ZmN02FGF6es2U4NqoEmgFb9Mbp2fRtonuscTIk+T60Ohzdq3B5qX PrLw== 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=3uBgSS331ci8dMtIdrtBWDRdwZon0X3NObzlAPqfYu8=; b=m2kdv2oCjZdGWk+HTwTqmSq8ju7McFSPAce+NxtcdsgkZ3mqNvPbOCoMUN5CLLJArS pjbuXQfi9XWEz81cxpSLjXZ+XbemG242Q8plov8oAmQifiGUmqQPgAXeFxkLGglTWr2G uFUyXRQSDy8LZwZiirbyyd/q67bCfeud04h/0R27BhW7XVZgMdt5KdLfg9zdtnn4ZiOO j8R4pUdhr5Kg8+q3G2PZmZAahQiwiUrf9xVCGWcFCU3JpATTClMV6NRmTywQ1USBXapJ k8tymtkw5RgP/rxWQ1lc9KQMwN73phkpFqwwERfkxinjM2D7g1frrFJ6DMZ3JqEsY4ke 6ncA== 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 ck14si4400886plb.198.2019.04.03.03.43.21; Wed, 03 Apr 2019 03:43:36 -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 S1726184AbfDCKmg (ORCPT + 99 others); Wed, 3 Apr 2019 06:42:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60484 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725935AbfDCKmg (ORCPT ); Wed, 3 Apr 2019 06:42:36 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 84698C04FFF1; Wed, 3 Apr 2019 10:42:35 +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 7307A19736; Wed, 3 Apr 2019 10:42:10 +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, pagupta@redhat.com Subject: [PATCH v4 5/5] xfs: disable map_sync for async flush Date: Wed, 3 Apr 2019 16:10:18 +0530 Message-Id: <20190403104018.23947-6-pagupta@redhat.com> In-Reply-To: <20190403104018.23947-1-pagupta@redhat.com> References: <20190403104018.23947-1-pagupta@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 03 Apr 2019 10:42:35 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index 1f2e2845eb76..dced2eb8c91a 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c @@ -1203,6 +1203,14 @@ xfs_file_mmap( if (!IS_DAX(file_inode(filp)) && (vma->vm_flags & VM_SYNC)) return -EOPNOTSUPP; + /* We don't support synchronous mappings with DAX files if + * dax_device is not synchronous. + */ + if (IS_DAX(file_inode(filp)) && !dax_synchronous( + xfs_find_daxdev_for_inode(file_inode(filp))) && + (vma->vm_flags & VM_SYNC)) + return -EOPNOTSUPP; + file_accessed(filp); vma->vm_ops = &xfs_file_vm_ops; if (IS_DAX(file_inode(filp))) -- 2.20.1