From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com ([192.55.52.151]:35490 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727749AbeGTWiv (ORCPT ); Fri, 20 Jul 2018 18:38:51 -0400 Date: Fri, 20 Jul 2018 15:48:39 -0600 From: Keith Busch To: "Verma, Vishal L" Cc: "Williams, Dan J" , "ross.zwisler@linux.intel.com" , "linux-nvdimm@lists.01.org" , "Jiang, Dave" , "stable@vger.kernel.org" Subject: Re: [PATCHv3 1/2] libnvdimm: Use max contiguous area for namespace size Message-ID: <20180720214838.GB4864@localhost.localdomain> References: <20180712154709.16444-1-keith.busch@intel.com> <1532119565.10343.15.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1532119565.10343.15.camel@intel.com> Sender: stable-owner@vger.kernel.org List-ID: On Fri, Jul 20, 2018 at 01:46:06PM -0700, Verma, Vishal L wrote: > $ cat /sys/bus/nd/devices/region1/max_available_extent > 17045651456 > > $ ndctl list -BNR --region=region1 > [ > { > "provider":"ACPI.NFIT", > "dev":"ndbus1", > "regions":[ > { > "dev":"region1", > "size":17045651456, > "available_size":0, > "type":"pmem", > "numa_node":0, > "persistence_domain":"unknown", > "namespaces":[ > { > "dev":"namespace1.0", > "mode":"raw", > "size":17045651456, > "sector_size":512, > "blockdev":"pmem1", > "numa_node":0 > } > ... > As we saw, getting the "available_size" directly from the the region's sysfs entry also returned the same as max extent: $ cat /sys/bus/nd/devices/region1/available_size 17045651456 The reason ndctl shows available_size as '0' is because the nstype is neither of type PMEM nor BLK. So I think max_available_extent is doing the right thing.