Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6802067imu; Mon, 21 Jan 2019 16:31:25 -0800 (PST) X-Google-Smtp-Source: ALg8bN7kPkNrtvoerUX1etLet8hUnauX2y6bIbNry7gFCqSxw3EzXTx13E8ioQGHW0WIeg7h4rNi X-Received: by 2002:a63:314d:: with SMTP id x74mr29765040pgx.10.1548117085186; Mon, 21 Jan 2019 16:31:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548117085; cv=none; d=google.com; s=arc-20160816; b=qoqHfKbWAqiOxarcfPTzK9ZopuqZHZEOZ1cLyB/JhQ2MgBUiYZ0N8TeEJPSJMwyDF5 HJQfICRnGDuQ8MOYRQGHnfRva6EG3k2n8t4h3kIvCT4xvl8BsIaDwJk/lApGfv0IYreG Oxy55Jp7lNuWh2Jt4+ZvNncKCGQVIOMOwzaLJkkl6kilfw34E6Lem8ZMDfqiQMPFImVk O113IC2VH6rwEYRD1It8B6yghkoKxXt9s5SPWBxkUTjMWJqDHijaoFpSEm7s+VGPITl5 lnFntEiyJELVKLdklXgPQ1BdpTgpLt08YnqgLPc/tRVSFddwCUsHmDKeThgi11mBJe8+ A/3Q== 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=ParTT2wvy8/2g4XMgKE4wg3TCRVhMdNQ49X488sZEX8=; b=cj9CKSp69SispqsX//ESwVYyZYueshzmjo2d/D+bp0BkErUL0JoobCchFpc60RnVow //JdRwHou3NJMiOUIpd6gQhyqWXluTIAvbUI2q6veMbqvR6wypsINGsI5j7bzsVcX1Wk b1q0mK/VTB10HOtle56MdtchXLzeu///CQbzfx6X3msnulc9ATEMoAu58Bw461X8cLf3 lxSqIdHfpCL9wDVxsqrbFJQfEcaZfXFs3gA90uLZddbjDUkMY3uhcjp3MndabyySV1oA 0fh1/btT0k0n64But8fAPMVXyDwn/NVxVesnQpunc5IHT5I3jJR59dJ0wZiTuumEuqR5 0rBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=v6EsnPuj; 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; 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 q14si7731542pgq.197.2019.01.21.16.31.09; Mon, 21 Jan 2019 16:31:25 -0800 (PST) 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; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=v6EsnPuj; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726468AbfAVA3V (ORCPT + 99 others); Mon, 21 Jan 2019 19:29:21 -0500 Received: from mail-ot1-f66.google.com ([209.85.210.66]:44453 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726042AbfAVA3V (ORCPT ); Mon, 21 Jan 2019 19:29:21 -0500 Received: by mail-ot1-f66.google.com with SMTP id f18so22099339otl.11 for ; Mon, 21 Jan 2019 16:29:20 -0800 (PST) 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=ParTT2wvy8/2g4XMgKE4wg3TCRVhMdNQ49X488sZEX8=; b=v6EsnPujYLp6DaDxnMx8cmn7DjA/AnzBhnovQYCyAhZzVjr1VyDh4ZMtmjrsyGmOcn r2ZN0DMvRjsoByH71MLpit+sWYQmarhxzceMKgX2oEpveccl9u298sXLWdhJ4V4fyeGI 3JdaWbxZQm8J9Js0zcp4lXJUKOxkPIJjqAjtJxU5spfdXD4p9YHEHi66/6rOB5X5cOOP r5ycTkU+N4m4zTz7xQ03ZCM+g6Lev1+4n5cUHvjkEfOybY2khh4C66DwoNj7n2Jo1OsI 8PyG8P9QvrwmCLFQTd3C4MW/IOfzaQHlCI05DIKxmJm6e24GauK7+mqXK4k5m0jPLtkN gEyA== 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=ParTT2wvy8/2g4XMgKE4wg3TCRVhMdNQ49X488sZEX8=; b=BshY286tWLW9go9p3AlLvJt2y4AhASFcf4Jevvy5Rr2H60NxMQArJPU9U437aK/IHH rv/ISt30MHpLFQG4MGAybxLr1sOG+nJKGNMkRwNLHjxXvjvqLES5ffpsdwIuIQKqApzo mY/c6e+iVgjL0mJRoy9ETqryaubc1p/bsaYUhXbI2orYXQdrHxo1n5Kt5QVOb95yCvxz CGsonpLyVMY1GG9C5puYpNtpZCUxwD+bSisu9c+x7zyAB9aWaLAuZnxvC9ZgF3hZaO0o WOP4nQjtf79ZdzyqIOY+ZyEbqbBkZoChf1veF2JWSCafJdphGX8JgTqVFIAdSlkOBefO FTFA== X-Gm-Message-State: AJcUukfCI/Cn9MB/ooVvD6uz0u5qj8tSeuLZsDkXiW9POwO0B+kW6MIx Av110ySC4njYg+Fjbj+GfTDAw1xZhTFlKzLv20EbWA== X-Received: by 2002:a9d:394:: with SMTP id f20mr19747872otf.98.1548116960377; Mon, 21 Jan 2019 16:29:20 -0800 (PST) MIME-Version: 1.0 References: <154785884329.2202034.3295476681016958230.stgit@dwillia2-desk3.amr.corp.intel.com> <20190122002615.GB5855@richard> In-Reply-To: <20190122002615.GB5855@richard> From: Dan Williams Date: Mon, 21 Jan 2019 16:29:08 -0800 Message-ID: Subject: Re: [PATCH] libnvdimm: Clarify nd_pfn_init() flow To: Wei Yang Cc: linux-nvdimm , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 21, 2019 at 4:26 PM Wei Yang wrote: [..] > >@@ -706,6 +711,22 @@ static int nd_pfn_init(struct nd_pfn *nd_pfn) > > sig = DAX_SIG; > > else > > sig = PFN_SIG; > >+ > >+ /* > >+ * Check for an existing 'pfn' superblock before writing a new > >+ * one. The intended flow is that on the first probe of an > >+ * nd_{pfn,dax} device the superblock is calculated and written > >+ * to the namespace. In this case nd_pfn_validate() returns > >+ * -ENODEV because no valid superblock exists currently. > > As you replied in following mail: > > 3/ If present, nd_pfn_validate() returns 0 and nd_dax_probe() > registers the dax0.1 device (this is a libnvdimm 'personality device). > > So at this point, nd_pfn_validate() return 0 or -ENODEV? In this case 0, because the configuration was successfully validated. -ENODEV, is only returned for the initial case where we want the kernel to write the configuration. All other error codes are an actual failure and the probe procedure stops.