Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp916565imu; Wed, 9 Jan 2019 08:29:18 -0800 (PST) X-Google-Smtp-Source: ALg8bN4DrvGy1b3RKne5ul29oMDtuc3yfLoEEXp9TYRPEzyZrRI8Gv21eFdnE1MRFFTpqwnpuMBY X-Received: by 2002:a17:902:d202:: with SMTP id t2mr6751388ply.193.1547051358730; Wed, 09 Jan 2019 08:29:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547051358; cv=none; d=google.com; s=arc-20160816; b=zORqY/IRTcTi+ighdZfZ06G8u7jt5bptJMTIWlOy6wrFeAeflOZGgDVN/dxbp/SL0D uYMczzOq6DpNjiOhSK3r7WzKIUt1TNqxGNAhN8eB+6/W8KWRSbtO2/0RD4MA2QwdyvsY nQ8CA9YgoawSxp8Ru5a8W/SKjXy6sh73Zr2Q4ydvUyhExG4pPtqGU3l/FqMmLVUPoFfS 0YpKXfALoQHZsESEVd1EsARy3/iYdGHNyo9vZTQpRleM5/7pd3pBKdbIbuHUsp9f3z/q X4tS6KSNj/atfADgXQKeKxqOg/XmDezf6+Rrj677afTiP0GV+TkiC0gSycB915VFEEKr Ej7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=J7iHfVSp/RGiNtOFtryaGPgBvTjKEy3xADeptGHhI4Q=; b=VixK3wQyYL5SO1X2qXnXMugqvFV3IYbKd/iXrffJECA9eG/4T27sHAabaW8uiRhaBD 0aeS6ikVMAo0ebR2KXl3AlyVBfO6Nh0PdEv3O9+N+qjH5PN7rYqpoxc0riQk5idUL8Ol s7yxsEpbAtFpwNNyfWAgvISTf79Oa94ZHOf5msjZ6OucBhxrDOw+SqmKoceArjEC1bt7 iW9Ce1ODZYb8aEDKBU7ZPGqSdAgZhy1jvmdAkYNrFNxVJWg46MolNaeqrcwQb/egRYZf bx+5bKFTZHcQWBJ1fNdMyo9s++Q/QZZnItO/tnB2UU9YkTPOftCZai6kF5ZskSBVlsj5 LKLQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y26si14850596pfd.25.2019.01.09.08.29.03; Wed, 09 Jan 2019 08:29:18 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731681AbfAIOmT (ORCPT + 99 others); Wed, 9 Jan 2019 09:42:19 -0500 Received: from mx2.suse.de ([195.135.220.15]:35120 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731544AbfAIOmT (ORCPT ); Wed, 9 Jan 2019 09:42:19 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D457EAD3C; Wed, 9 Jan 2019 14:42:16 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 77B101E11E5; Wed, 9 Jan 2019 15:42:15 +0100 (CET) Date: Wed, 9 Jan 2019 15:42:15 +0100 From: Jan Kara To: Pankaj Gupta Cc: 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, 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 Subject: Re: [PATCH v3 4/5] ext4: disable map_sync for virtio pmem Message-ID: <20190109144215.GI15397@quack2.suse.cz> References: <20190109135606.15401-1-pagupta@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190109135606.15401-1-pagupta@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 09-01-19 19:26:05, Pankaj Gupta wrote: > Virtio pmem provides asynchronous host page cache flush > mechanism. We don't support 'MAP_SYNC' with virtio pmem > and ext4. > > Signed-off-by: Pankaj Gupta ... > @@ -371,6 +373,13 @@ static int ext4_file_mmap(struct file *file, struct vm_area_struct *vma) > if (!IS_DAX(file_inode(file)) && (vma->vm_flags & VM_SYNC)) > return -EOPNOTSUPP; > > + /* We don't support synchronous mappings with guest direct access > + * and virtio based host page cache flush mechanism. > + */ > + if (IS_DAX(file_inode(file)) && virtio_pmem_host_cache_enabled(dax_dev) > + && (vma->vm_flags & VM_SYNC)) > + return -EOPNOTSUPP; > + Shouldn't there rather be some generic way of doing this? Having virtio_pmem_host_cache_enabled() check in filesystem code just looks like filesystem sniffing into details is should not care about... Maybe just naming this (or having a wrapper) dax_dev_map_sync_supported()? Honza -- Jan Kara SUSE Labs, CR