Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp244630yba; Wed, 15 May 2019 23:28:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqw7u94pBjmQPPVLVhVfr7fwkAKYKZr/AXW2wIqXbILPG3iuVvTffY7MTOntBya+jiA88Wb6 X-Received: by 2002:a17:902:e48e:: with SMTP id cj14mr44910908plb.299.1557988132469; Wed, 15 May 2019 23:28:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557988132; cv=none; d=google.com; s=arc-20160816; b=D13IBPdYmrc1UehUfDYHzrKzO7MtR73fbGAoICn3u0qwTC2LUpYQB1Z7LhfZFJwflz v1SiYY9I/v4KEjW+6ng8ijWb/zqnUWPeaWRoX14w2MWmKNcb0SwfhGK45VhzngImrB/Z TTXnfSSn9E7vwu8jyyLdH38A2iZlM82t9aODgdQp1WIizD/cOWzC1SJ8GQM8BnUYlctJ o34hpXyUBSsRl1On4MTVnkU5SZPVBUolX8iXiVFzmIv2cC6shct40nNpGXrUNfhNkjpZ NffM6Oiq4uARGSd1pphhiAHaJmFlRrMydjrObKaOtzLsW0u6HcM8jtsA9GHU/K3RtKU1 sORw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date; bh=TxQURMXBzL9ZOpHnpHW/7xmQBz0mLhMJydtMxLDSeIA=; b=raR3+RJlSOpI7jrH50yLDz8WbR5JdEkE/rI7R+ydWDwvn5uc9IVu6nqZDS8fpoGdkE K1xseGUNh+aG2StwE0cHyObAuNFo3rV0YgRRe5WbFx/n1wCUNV44T+m1MkqOhfW1QqCZ n4X2Mu91cBkwRRwCz+g0O72a42SDCL83BzBgdatbuwN9aPrJEn2Kyq8z4AlyQhFZ/QrW PhcXqPYWdETw5SO9IyY8sVlLunPsClkHGYiMxofFaAd7ibX3839b5nEuWPa2P91iNkdk /Vgf8cg9dTUZTKryKHoh/ZSETS29H+4rUfDqT8OlA+wwCuN2uAFkK163VENS9uYpyzZG CDxg== ARC-Authentication-Results: i=1; mx.google.com; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ay3si3846779plb.298.2019.05.15.23.28.27; Wed, 15 May 2019 23:28:52 -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; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726277AbfEPG2Y convert rfc822-to-8bit (ORCPT + 99 others); Thu, 16 May 2019 02:28:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34732 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726221AbfEPG2Y (ORCPT ); Thu, 16 May 2019 02:28:24 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 21F1B3DDBE; Thu, 16 May 2019 06:28:23 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F29145D9C3; Thu, 16 May 2019 06:28:22 +0000 (UTC) Received: from zmail21.collab.prod.int.phx2.redhat.com (zmail21.collab.prod.int.phx2.redhat.com [10.5.83.24]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 973501806B11; Thu, 16 May 2019 06:28:21 +0000 (UTC) Date: Thu, 16 May 2019 02:28:20 -0400 (EDT) From: Pankaj Gupta To: Dan Williams 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 Message-ID: <1906905099.29162562.1557988100975.JavaMail.zimbra@redhat.com> In-Reply-To: References: <20190514145422.16923-1-pagupta@redhat.com> <20190514145422.16923-2-pagupta@redhat.com> Subject: Re: [PATCH v9 1/7] libnvdimm: nd_region flush callback support MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Originating-IP: [10.65.16.97, 10.4.195.4] Thread-Topic: libnvdimm: nd_region flush callback support Thread-Index: VrjlK3y+QUdLL94hHE7OyUkrop5Ojw== X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 16 May 2019 06:28:23 +0000 (UTC) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org > > > > This patch adds functionality to perform flush from guest > > to host over VIRTIO. We are registering a callback based > > on 'nd_region' type. virtio_pmem driver requires this special > > flush function. For rest of the region types we are registering > > existing flush function. Report error returned by host fsync > > failure to userspace. > > > > Signed-off-by: Pankaj Gupta > > --- > > drivers/acpi/nfit/core.c | 4 ++-- > > drivers/nvdimm/claim.c | 6 ++++-- > > drivers/nvdimm/nd.h | 1 + > > drivers/nvdimm/pmem.c | 13 ++++++++----- > > drivers/nvdimm/region_devs.c | 26 ++++++++++++++++++++++++-- > > include/linux/libnvdimm.h | 8 +++++++- > > 6 files changed, 46 insertions(+), 12 deletions(-) > > > > diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c > > index 5a389a4f4f65..08dde76cf459 100644 > > --- a/drivers/acpi/nfit/core.c > > +++ b/drivers/acpi/nfit/core.c > > @@ -2434,7 +2434,7 @@ static void write_blk_ctl(struct nfit_blk *nfit_blk, > > unsigned int bw, > > offset = to_interleave_offset(offset, mmio); > > > > writeq(cmd, mmio->addr.base + offset); > > - nvdimm_flush(nfit_blk->nd_region); > > + nvdimm_flush(nfit_blk->nd_region, NULL); > > > > if (nfit_blk->dimm_flags & NFIT_BLK_DCR_LATCH) > > readq(mmio->addr.base + offset); > > @@ -2483,7 +2483,7 @@ static int acpi_nfit_blk_single_io(struct nfit_blk > > *nfit_blk, > > } > > > > if (rw) > > - nvdimm_flush(nfit_blk->nd_region); > > + nvdimm_flush(nfit_blk->nd_region, NULL); > > > > rc = read_blk_stat(nfit_blk, lane) ? -EIO : 0; > > return rc; > > diff --git a/drivers/nvdimm/claim.c b/drivers/nvdimm/claim.c > > index fb667bf469c7..13510bae1e6f 100644 > > --- a/drivers/nvdimm/claim.c > > +++ b/drivers/nvdimm/claim.c > > @@ -263,7 +263,7 @@ static int nsio_rw_bytes(struct nd_namespace_common > > *ndns, > > struct nd_namespace_io *nsio = to_nd_namespace_io(&ndns->dev); > > unsigned int sz_align = ALIGN(size + (offset & (512 - 1)), 512); > > sector_t sector = offset >> 9; > > - int rc = 0; > > + int rc = 0, ret = 0; > > > > if (unlikely(!size)) > > return 0; > > @@ -301,7 +301,9 @@ static int nsio_rw_bytes(struct nd_namespace_common > > *ndns, > > } > > > > memcpy_flushcache(nsio->addr + offset, buf, size); > > - nvdimm_flush(to_nd_region(ndns->dev.parent)); > > + ret = nvdimm_flush(to_nd_region(ndns->dev.parent), NULL); > > + if (ret) > > + rc = ret; > > > > return rc; > > } > > diff --git a/drivers/nvdimm/nd.h b/drivers/nvdimm/nd.h > > index a5ac3b240293..0c74d2428bd7 100644 > > --- a/drivers/nvdimm/nd.h > > +++ b/drivers/nvdimm/nd.h > > @@ -159,6 +159,7 @@ struct nd_region { > > struct badblocks bb; > > struct nd_interleave_set *nd_set; > > struct nd_percpu_lane __percpu *lane; > > + int (*flush)(struct nd_region *nd_region, struct bio *bio); > > So this triggers: > > In file included from drivers/nvdimm/e820.c:7: > ./include/linux/libnvdimm.h:140:51: warning: ‘struct bio’ declared > inside parameter list will not be visible outside of this definition > or declaration > int (*flush)(struct nd_region *nd_region, struct bio *bio); > ^~~ Sorry! for this. Fixed now. > I was already feeling uneasy about trying to squeeze this into v5.2, > but this warning and the continued drip of comments leads me to > conclude that this driver would do well to wait one more development > cycle. Lets close out the final fixups and let this driver soak in > -next. Then for the v5.3 cycle I'll redouble my efforts towards the > goal of closing patch acceptance at the -rc6 / -rc7 development > milestone. o.k. Will wait for Mike's ACK on device mapper patch and send the v10 with final fix-ups. Thank you for your help. Best regards, Pankaj >