I have tough time to image any scenarios that could make sense a zero-sized device.
-----Original Message----- From: Matthew Wilcox [mailto:[email protected]] Sent: Monday, July 10, 2017 1:30 PM To: Dan Williams <[email protected]> Cc: [email protected]; Cheng-mean Liu (SOCCER) <[email protected]>; Matthew Wilcox <[email protected]> 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 [email protected] https://lists.01.org/mailman/listinfo/linux-nvdimm
