Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2527900yba; Fri, 10 May 2019 13:15:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqwCcxyeEpMbTGuBFP4uspYtAOySBp1oCk0qQWAwyii+oRfPwKf1Ag07F4wcvnrAk9MwQrQk X-Received: by 2002:a17:902:e00f:: with SMTP id ca15mr15738448plb.76.1557519337310; Fri, 10 May 2019 13:15:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557519337; cv=none; d=google.com; s=arc-20160816; b=FWuOUXsgmk6aNHAPGtLrhUM5pdJ/DNui3AmPs2B6yaYkX8+5ZSsJTYTRmazNKdRrMr DXr/PfRp1RGQYkqnNHzFnLumExhHenXXbkOJsFcCKVsXFicdr29wG7h/hYbKjn5QtIZa oPk3OioZQt8gC3Aaxfz3ry5uk08VreSStZbGYigevQScSxy7GYdfx9RQWAGp5QqwYDTX +m523EEfHa3+VjfMTL+rYpQ2scIo0WhAMy60zZ35eOqv7tpfBcfUGzf/pcIvdMmDhJRm jmxvAWebQqFyYynXMbP92tAmXqRVUVfLNkcO62O4ysa1roXk3cRBeAiqgx6SdKwldIlD eAzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=glYXor0GQ9DfKpghbnKPKxe+zUzoJeb7GoYJ26Vk6ps=; b=LMcLbfwnCBZKlUvCWkAa56UTQqSWjVG40i2SwF/5yGSSTtuwb9FxSplN/3NU+ta8x8 fvrCvM4bQAHNhxGgBBKdwTs5BMK/hO381rQ48RWJ2WRSu0zbuAhBnGjTIHtwZ4UTZC1e ATZTTx70WTl3R3QOwKoKZDas83lMed7w9vieyBbisZUYVXSzGg8u6t9tR44pcQcrsB7v 1kygzZrydEn6QxHOwlnMMy43uEbPU9AbgqTYKDt0I7n1dy0mKkXMTTWCI7aj2QfkRyn+ VBbmZ/Bs8S7Mgsus5R11VBu0uESezuA+jjLMTfmnRPRx7EOhqTxd74hzrihsI4vjoOQl CQVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b="yf8U/Vwd"; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z186si8259281pgd.126.2019.05.10.13.15.18; Fri, 10 May 2019 13:15:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b="yf8U/Vwd"; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727968AbfEJUOT (ORCPT + 99 others); Fri, 10 May 2019 16:14:19 -0400 Received: from mail-oi1-f193.google.com ([209.85.167.193]:41326 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727676AbfEJUOS (ORCPT ); Fri, 10 May 2019 16:14:18 -0400 Received: by mail-oi1-f193.google.com with SMTP id y10so5413515oia.8 for ; Fri, 10 May 2019 13:14:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=glYXor0GQ9DfKpghbnKPKxe+zUzoJeb7GoYJ26Vk6ps=; b=yf8U/VwdNl5tfgFPEKe5qh3THkRWZb9un60SOgkfJ/5LhvAwk90OALPbQmqH8NGPZg Cr23IQd+McBJGud2E9ep2+5K3niud5mH6fhTcdytKwGg0ifP80vvI1KiLl0J9xx4xwjq TEllzhY/P52SG7Zgqu0zO0TcVHYyKzcfJiA7uwMKIIPnUXohIrhjvrd+s0fzp7fbWFpQ y62fi/8hXK8LlUhb+lV4PauDhwTsmzrWQoEzPH1EBWKu2DNHNpcM/c0ugQiTxq1CS/Pn ELZfOgWViQuoOxYDdqZ2L8n4KiCZbfdn+ONJLYDNxFTBB6M7dS0ALwRsezeWWJXIVakV lNVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=glYXor0GQ9DfKpghbnKPKxe+zUzoJeb7GoYJ26Vk6ps=; b=VzlOioezYSCMUHwrHyFZJWphKE6TN8oKsQO46JJHrjgXw6W64NnuVEmwPR9tbdpP1B YPJG7IQwXtute2Z/6PCgEmnKMNIO8V5WX6XZWD+nVtI8pBQRFqaS1naQBiseUYpteIwP hzVGsxsHC6JOnE+L90UQ+ab+5Y92FaxQhF6jJzm5BowK1AbHJWm2Bu0ffYLJDfduDcvS eP2PyLr2ABteiU+tguQvI3kJnecnvbuud90+S6VeVRa7buyYpcIW7dL9vFZhj8qjtjeo P0gAOudq6FaAr0wgwi3YdBH7y6wjuQXxX4uXsOldCpT7z/jWx6aa4sjqNkJM2HhZt+6w bECA== X-Gm-Message-State: APjAAAWK5Bs2/gKu4yM0WrPts8fX+FRpJPeye2FSAF/v6s+H0IkCcwYx zSlOo9lf1cYnlVsUi4yzPYQE6kwkaK/wLVk8GXuZXg== X-Received: by 2002:aca:4208:: with SMTP id p8mr6821131oia.105.1557519257995; Fri, 10 May 2019 13:14:17 -0700 (PDT) MIME-Version: 1.0 References: <20190510155202.14737-1-pagupta@redhat.com> <20190510155202.14737-4-pagupta@redhat.com> In-Reply-To: <20190510155202.14737-4-pagupta@redhat.com> From: Dan Williams Date: Fri, 10 May 2019 13:14:07 -0700 Message-ID: Subject: Re: [PATCH v8 3/6] libnvdimm: add dax_dev sync flag To: Pankaj Gupta Cc: linux-nvdimm , Linux Kernel Mailing List , virtualization@lists.linux-foundation.org, KVM list , linux-fsdevel , Linux ACPI , Qemu Developers , linux-ext4 , linux-xfs , Ross Zwisler , Vishal L Verma , Dave Jiang , "Michael S. Tsirkin" , Jason Wang , Matthew Wilcox , "Rafael J. Wysocki" , Christoph Hellwig , Len Brown , Jan Kara , "Theodore Ts'o" , Andreas Dilger , "Darrick J. Wong" , lcapitulino@redhat.com, Kevin Wolf , Igor Mammedov , jmoyer , Nitesh Narayan Lal , Rik van Riel , Stefan Hajnoczi , Andrea Arcangeli , David Hildenbrand , david , cohuck@redhat.com, Xiao Guangrong , Paolo Bonzini , Adam Borowski , yuval shaia , jstaron@google.com Content-Type: text/plain; charset="UTF-8" Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, May 10, 2019 at 8:53 AM Pankaj Gupta wrote: > > This patch adds 'DAXDEV_SYNC' flag which is set > for nd_region doing synchronous flush. This later > is used to disable MAP_SYNC functionality for > ext4 & xfs filesystem for devices don't support > synchronous flush. > > Signed-off-by: Pankaj Gupta > --- > drivers/dax/bus.c | 2 +- > drivers/dax/super.c | 13 ++++++++++++- > drivers/md/dm.c | 3 ++- > drivers/nvdimm/pmem.c | 5 ++++- > drivers/nvdimm/region_devs.c | 7 +++++++ > include/linux/dax.h | 8 ++++++-- > include/linux/libnvdimm.h | 1 + > 7 files changed, 33 insertions(+), 6 deletions(-) [..] > diff --git a/drivers/md/dm.c b/drivers/md/dm.c > index 043f0761e4a0..ee007b75d9fd 100644 > --- a/drivers/md/dm.c > +++ b/drivers/md/dm.c > @@ -1969,7 +1969,8 @@ static struct mapped_device *alloc_dev(int minor) > sprintf(md->disk->disk_name, "dm-%d", minor); > > if (IS_ENABLED(CONFIG_DAX_DRIVER)) { > - dax_dev = alloc_dax(md, md->disk->disk_name, &dm_dax_ops); > + dax_dev = alloc_dax(md, md->disk->disk_name, &dm_dax_ops, > + DAXDEV_F_SYNC); Apologies for not realizing this until now, but this is broken. Imaging a device-mapper configuration composed of both 'async' virtio-pmem and 'sync' pmem. The 'sync' flag needs to be unified across all members. I would change this argument to '0' and then arrange for it to be set at dm_table_supports_dax() time after validating that all components support synchronous dax.