Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp812781imu; Wed, 9 Jan 2019 06:51:55 -0800 (PST) X-Google-Smtp-Source: ALg8bN6SVYBYa7g333n5b4gszprHRJWFyfw0q7Vqd+TxnrB7cavqWs0uUvgW7bEK2NSPGrcqmHu+ X-Received: by 2002:a17:902:9006:: with SMTP id a6mr6260613plp.334.1547045515522; Wed, 09 Jan 2019 06:51:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547045515; cv=none; d=google.com; s=arc-20160816; b=tsOu8AHK1Pc60FQYao8deRBtW2vHw43Y2qKb3pqRrOHnYmpKcIILSlOzNk+Nv/t6v3 Uz3PQMuZvYjBSmNVERDSXH86Cg35ct6SJB5XOIGqpPMUo6PTf9opvjR1j//HQvrnt/2b m42Meg86Vwtg805ul9x4tYanNMbuZIZE5REXioTzjQhqFW3CZ3xxAEGuTSdJ5UaEjdhL dV08VVBa0OEgwrQYFrRDZYZHMeFRnwCew1XJG/sF+KGPs9mv+3OLdCWANELEPrwvX0nn mvpt0kW/QDeX10FNVluj4TjGdWWtIfiEtexmvFnI7+tpF3THGIg79DW3m4OF3CrolnZS 8s7w== 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=cGH62kYHHsAsgYc5G4f0hiDhJERAUozzgNIGQS3+Ovo=; b=N23Ly/scJeJlhxNKxU5xzRE/OJrS1vtKbmMNQA2qeU1kZYhDcqC8ZT/6wsnwL2QJjs lLC3xekmREuiSabLQphPBDxmjiSs5Y5RmrqeBANxo6Ij/GxTDUrH/SDKLZ+0LZF1wrn8 ZlCgNNPLN1AtIvcAZZhicPgm/akHc/MecfNozDG+0IeTlXj9H/2z1+teg9yZQMMO59mP FAStIPI0rQpqLvSScDA0zqr3XK1ksnhi+qeHr7m7r0TF0PNmwzKnKBlVfCTdlRRG+sSE x80ubOD8y0kU9fgdZV1NhhE6lb+ijFGV9z2DTnh52vUmw1636/uWbqaL8hwlKhmpMcfe wsoA== 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 h5si1298181pgc.237.2019.01.09.06.51.39; Wed, 09 Jan 2019 06:51:55 -0800 (PST) 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 S1732101AbfAIOuT (ORCPT + 99 others); Wed, 9 Jan 2019 09:50:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:15115 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732080AbfAIOuR (ORCPT ); Wed, 9 Jan 2019 09:50:17 -0500 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 0A573C07DE99; Wed, 9 Jan 2019 14:50:17 +0000 (UTC) Received: from dhcp201-121.englab.pnq.redhat.com (dhcp-10-65-161-12.pnq.redhat.com [10.65.161.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6B4A45D76B; Wed, 9 Jan 2019 14:49:45 +0000 (UTC) From: Pankaj Gupta To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, qemu-devel@nongnu.org, linux-nvdimm@ml01.01.org, linux-fsdevel@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-acpi@vger.kernel.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org Cc: jack@suse.cz, stefanha@redhat.com, dan.j.williams@intel.com, riel@surriel.com, nilal@redhat.com, kwolf@redhat.com, pbonzini@redhat.com, zwisler@kernel.org, vishal.l.verma@intel.com, dave.jiang@intel.com, david@redhat.com, jmoyer@redhat.com, xiaoguangrong.eric@gmail.com, hch@infradead.org, mst@redhat.com, jasowang@redhat.com, lcapitulino@redhat.com, imammedo@redhat.com, eblake@redhat.com, willy@infradead.org, tytso@mit.edu, adilger.kernel@dilger.ca, darrick.wong@oracle.com, rjw@rjwysocki.net, pagupta@redhat.com Subject: [PATCH v3 5/5] xfs: disable map_sync for virtio pmem Date: Wed, 9 Jan 2019 20:17:36 +0530 Message-Id: <20190109144736.17452-6-pagupta@redhat.com> In-Reply-To: <20190109144736.17452-1-pagupta@redhat.com> References: <20190109144736.17452-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.31]); Wed, 09 Jan 2019 14:50:17 +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 e474250..eae4aa4 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c @@ -1190,6 +1190,14 @@ xfs_file_mmap( if (!IS_DAX(file_inode(filp)) && (vma->vm_flags & VM_SYNC)) return -EOPNOTSUPP; + /* We don't support synchronous mappings with guest direct access + * and virtio based host page cache mechanism. + */ + if (IS_DAX(file_inode(filp)) && virtio_pmem_host_cache_enabled( + 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.9.3