Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp57890yba; Wed, 3 Apr 2019 04:31:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqwblpDzYllF/AEO3Npn72MAREn309W9erlDQkTr1pq/ooME4FONN7xroFuReyDJqYV0/+sK X-Received: by 2002:a63:243:: with SMTP id 64mr33916229pgc.214.1554291111102; Wed, 03 Apr 2019 04:31:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554291111; cv=none; d=google.com; s=arc-20160816; b=CGcFQCCntAfqV+ubQUJMCCYcSdBhSOsJICHAISMdA8wy7ivoRTdkSdHE3rBnYBbENI 3rN11pmi92SUsqyiWqeiY51s6XfuuXo6VWAdPE+yOcm1ga7z7nMOA7yAhIK7cWgKRb+9 c/BpWnrZPIdWKCw9Ihs91oKRl97g7VxWwIQ3IpBS8N2qegiTr8Ffd3h+K/AqsNUG5ac7 E63dbYv2LXXtkQf0ELiaz+/dqf/rBkm1HEquWFiWVUusezgzxSLtxkAEFnz1N8AgW8Rq EFX6g3xQ3HNoBodjtuUTv1p+li3frGYhtKVXYWX0lwQTW7ZF7pT/UfS8BllLL820M5d6 GsQg== 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=7+l2RlAaAlNuccB8FRkHGQnpfPiyKFxsWh8XeMUWN60=; b=t/DxGlUzaKrqyTNyKZn+hEvpPKgzLIEZnt8jE5RbMKI7PlIHklF0o23pejqu3hv18m C9DAk5f8AKlwxg3WkwiJVxvR60G8dHRth6tlsOtQjQYKvteH90eN3/cwDUL8Jzywjupk cfgU2wVM5gCYEzGvuBuexzHnW9xWL5T5AXKddRrnjiobHqPhmSgkyDX5zmxEq2sxS9SJ xH7ssVCER2OMYJ0owFZUFc98MjpMTIxXtFa0oeWlg6//H6tBhK8AlRCMt89CBuvJg+jf 4F8ZjquBk/rdtY3Z6hh/dOH+LbwGwMNH8Bg8a/KHWUuzViXDhAi7ivVt1gsQnjs/Hodj HSHg== 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 a3si13673944pgg.127.2019.04.03.04.31.35; Wed, 03 Apr 2019 04:31:51 -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 S1726499AbfDCLay (ORCPT + 99 others); Wed, 3 Apr 2019 07:30:54 -0400 Received: from mx2.suse.de ([195.135.220.15]:59004 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725935AbfDCLay (ORCPT ); Wed, 3 Apr 2019 07:30:54 -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 D469DAE0E; Wed, 3 Apr 2019 11:30:51 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id BF4351E3FFD; Wed, 3 Apr 2019 13:30:49 +0200 (CEST) Date: Wed, 3 Apr 2019 13:30:49 +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 Subject: Re: [PATCH v4 4/5] ext4: disable map_sync for async flush Message-ID: <20190403113049.GF8836@quack2.suse.cz> References: <20190403104018.23947-1-pagupta@redhat.com> <20190403104018.23947-5-pagupta@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190403104018.23947-5-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 03-04-19 16:10:17, 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 The patch looks good to me. You can add: Reviewed-by: Jan Kara Honza > --- > fs/ext4/file.c | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > > diff --git a/fs/ext4/file.c b/fs/ext4/file.c > index 69d65d49837b..86e4bf464320 100644 > --- a/fs/ext4/file.c > +++ b/fs/ext4/file.c > @@ -360,8 +360,10 @@ 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; > > /* > @@ -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 DAX files if > + * dax_device is not synchronous. > + */ > + if (IS_DAX(file_inode(file)) && !dax_synchronous(dax_dev) > + && (vma->vm_flags & VM_SYNC)) > + return -EOPNOTSUPP; > + > file_accessed(file); > if (IS_DAX(file_inode(file))) { > vma->vm_ops = &ext4_dax_vm_ops; > -- > 2.20.1 > -- Jan Kara SUSE Labs, CR