From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 660B4C10F14 for ; Tue, 23 Apr 2019 14:27:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3E0FC21738 for ; Tue, 23 Apr 2019 14:27:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728194AbfDWO1v (ORCPT ); Tue, 23 Apr 2019 10:27:51 -0400 Received: from mx2.suse.de ([195.135.220.15]:43020 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727839AbfDWO1v (ORCPT ); Tue, 23 Apr 2019 10:27:51 -0400 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 C1573AC44; Tue, 23 Apr 2019 14:27:49 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id AA27C1E15B7; Tue, 23 Apr 2019 16:27:48 +0200 (CEST) Date: Tue, 23 Apr 2019 16:27:48 +0200 From: Jan Kara To: Pankaj Gupta Cc: 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, 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, yuval.shaia@oracle.com, kilobyte@angband.pl Subject: Re: [PATCH v6 5/6] ext4: disable map_sync for async flush Message-ID: <20190423142748.GE9910@quack2.suse.cz> References: <20190423080612.15361-1-pagupta@redhat.com> <20190423080612.15361-6-pagupta@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190423080612.15361-6-pagupta@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Tue 23-04-19 13:36:11, Pankaj Gupta wrote: > 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 ext4. > > Signed-off-by: Pankaj Gupta The patch looks good to me. You can add: Reviewed-by: Jan Kara Honza > --- > fs/ext4/file.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/fs/ext4/file.c b/fs/ext4/file.c > index 69d65d49837b..4b2ccaf1932e 100644 > --- a/fs/ext4/file.c > +++ b/fs/ext4/file.c > @@ -360,15 +360,16 @@ static const struct vm_operations_struct ext4_file_vm_ops = { > static int ext4_file_mmap(struct file *file, struct vm_area_struct *vma) > { > struct inode *inode = file->f_mapping->host; > + struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb); > + struct dax_device *dax_dev = sbi->s_daxdev; > > - if (unlikely(ext4_forced_shutdown(EXT4_SB(inode->i_sb)))) > + if (unlikely(ext4_forced_shutdown(sbi))) > return -EIO; > > - /* > - * 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(file)) && (vma->vm_flags & VM_SYNC)) > + if (!daxdev_mapping_supported(vma, dax_dev)) > return -EOPNOTSUPP; > > file_accessed(file); > -- > 2.20.1 > -- Jan Kara SUSE Labs, CR