I have tough time to image any scenarios that could make sense a zero-sized 
device.

-----Original Message-----
From: Matthew Wilcox [mailto:wi...@infradead.org] 
Sent: Monday, July 10, 2017 1:30 PM
To: Dan Williams <dan.j.willi...@intel.com>
Cc: linux-nvdimm@lists.01.org; Cheng-mean Liu (SOCCER) <socc...@microsoft.com>; 
Matthew Wilcox <mawil...@microsoft.com>
Subject: Re: [PATCH] nvdimm: Remove minimum size requirement

On Mon, Jul 10, 2017 at 11:41:08AM -0700, Dan Williams wrote:
> >         size = nvdimm_namespace_capacity(ndns);
> > -       if (size < ND_MIN_NAMESPACE_SIZE) {
> > -               dev_dbg(&ndns->dev, "%pa, too small must be at least %#x\n",
> > -                               &size, ND_MIN_NAMESPACE_SIZE);
> > +       if (size < PAGE_SIZE) {
> 
> If we're going to change the print level away from 'debug' then I 
> think this should be "if (size && size < PAGE_SIZE)". The sub-system 
> pre-creates 0-sized devices that are later configured into full 
> namespaces, in those cases we shouldn't fire the warning.

Should we allow drivers to claim zero-sized devices?  If not, then the
dev_warn() should be predicated on size being non-zero, but the return -ENODEV 
should still trigger.
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

Reply via email to