Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3655477yba; Tue, 23 Apr 2019 07:29:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqynbCEIz3ExJDIcu6Lzy5YO8Q1dl51dpmKYplF3NxABUoQhOcKXlG0dBAD+zDqudKgcoeLq X-Received: by 2002:a62:7d57:: with SMTP id y84mr1877240pfc.52.1556029744981; Tue, 23 Apr 2019 07:29:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556029744; cv=none; d=google.com; s=arc-20160816; b=fKIFEXKF9uCiFqCaTkEd2ChnUVRc8tq6U++5fa0IxY5oXznvNdMqQHdfzY8ZK7IztZ yHbYC3xwslbLCf5npjVEdhD7Qo1Ykw48c6x0sAWNdJdxWGoFiChOhbuibXkgj2U6c4ae /Yf0VJ8C17Bt0Mo2p7w4Ke6YkeI5M4dAsUdNSlTE6LmaeUluHV4WhY4ute+ZRSKf1Z4j F5jeUaCNmwFN7v+kBAi95aYm2DcF8vN8GNXIsTYG//MA80VJ/qEplfw+kbRJLa9U0k3L BDGtk0Ml2SzJCsx8Lsa12w6kh9G8WhxSNzROru2bbTOAct8jIy+bR8Dnt5nvwMJjfICn j+vg== 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=czEyjtAhOZmQwNeucx576KjUDXlNR9nKwD+HkfpCuxQ=; b=ycxpBe2xZejQdbIM0y8CYr87dxCCHMvHutWfRV6DXXna8YG4f/2tGknXlyRNOpyCIN TZmZrfqsKitxo2N7Xg+9QYf9HiOOTEGmoxETSZoDDpen25YSqV4hOFB1xdL0Uad3Ar/I TlvchFYEJXQPhdry/pjS3SgEXFp/D1+iQSobf00SpPGjKDWUlKamLwWreofue57bGy5c pMVJ4e4FZ1u9ie8TrNQJhORGPp6NyiYL1RW/G/+IA+FZke/5KJTRipS+TySQNl50vp0b dk7TQsLaxlAeVXmffLj3ux5452M74snkMHwq21lwDTQbyihDe3joTLvL+TevGqdh2OBT kzzg== 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 v28si2892485pgk.42.2019.04.23.07.28.49; Tue, 23 Apr 2019 07:29:04 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728254AbfDWO1w (ORCPT + 99 others); Tue, 23 Apr 2019 10:27:52 -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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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