Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp756300imu; Wed, 9 Jan 2019 05:58:14 -0800 (PST) X-Google-Smtp-Source: ALg8bN5zK3OrdHastbYcEf5SjENJHnUlZLllva8gVLEtCDoMdy86EbbIrnhsgr2xif97ARSBzzNy X-Received: by 2002:a17:902:a40f:: with SMTP id p15mr6284597plq.286.1547042294351; Wed, 09 Jan 2019 05:58:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547042294; cv=none; d=google.com; s=arc-20160816; b=M1eY7BfzsKQV2YLLaYtAY7QA/0lHEEyHkr764kzsLWVldbd6zcFGFjOcIx/kb2zH6V cMOz5fJlF6WxqFmyN6rUjb/u7zxssaFI7G1W6t3BhEqLlNKFfgzjWRGPr3Q3bQVBXRge fNKS6Io8fqu3hSPfAAu9bfHiuLRhQ/ia72HMiEzlaOgBGHwOviASiqDW2kII4iBKsICg YqxaDm/uMbcrjZHRc67y4bArn4kZNRds8UZbJ8Aa+f4mFnl8C9Ix+mIRRRAJnxl+Odwb DGIZlXutVFkP9M8KV+UNYGk3PnP6Hossjr1y+qebb3AZgNJGoSE4DLSF/ImkzTtRemOI GuiQ== 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=sNQYZGSQlGx4as+aht341PZS8ZD8DTa6bbkTt9xfQbzCvC4TZy8Bggw3uR+tDIV+Rq yDBAokQrrsa50pXEbjERiq03QVnla8tn+ZERh1URk9GnwpZDfvbSF3t9Xne0OHBQmDSG 2ZdYd04dw/P0O0coFky8wGpkTxX7O622veeb0TmilEu8naiIiJaaxMcgI4YNF+1M29RC UmTUHE36clpI2f0S5Zcn7elyK4RIq3vLoEVHAAWyif6pGoF5v4YY78obvyS+IO05v57p XviIPxea5LIQyu+dC8bDeV4mKOmZ4y6y6f6T1WCmcGAuYNe3s067UBulEhhCawWAobRj iCjg== 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 t136si27619939pfc.262.2019.01.09.05.57.59; Wed, 09 Jan 2019 05:58:14 -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 S1731056AbfAIN4c (ORCPT + 99 others); Wed, 9 Jan 2019 08:56:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41044 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730527AbfAIN4b (ORCPT ); Wed, 9 Jan 2019 08:56:31 -0500 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 D1AA1AC600; Wed, 9 Jan 2019 13:56:29 +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 C5731600C9; Wed, 9 Jan 2019 13:56:19 +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 19:26:06 +0530 Message-Id: <20190109135606.15401-2-pagupta@redhat.com> In-Reply-To: <20190109135606.15401-1-pagupta@redhat.com> References: <20190109135606.15401-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.28]); Wed, 09 Jan 2019 13:56:30 +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