Linux-Block Archive on lore.kernel.org
 help / Atom feed
* [PATCH v2] null_blk: add zoned config support information
@ 2019-01-04 17:06 John Pittman
  2019-01-04 21:49 ` Bart Van Assche
  0 siblings, 1 reply; 4+ messages in thread
From: John Pittman @ 2019-01-04 17:06 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, loberman, bvanassche, John Pittman

If the kernel is built without CONFIG_BLK_DEV_ZONED, a modprobe
of the null_blk driver with zoned=1 fails with 'Invalid argument'.
This can be confusing to users, prompting a search as to why the
parameter is invalid. To assist in that search, add a bit more
information to the failure, additionally adding to the documentation
that CONFIG_BLK_DEV_ZONED is needed for zoned=1.

Signed-off-by: John Pittman <jpittman@redhat.com>
---
 Documentation/block/null_blk.txt | 3 ++-
 drivers/block/null_blk.h         | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/block/null_blk.txt b/Documentation/block/null_blk.txt
index ea2dafe49ae8..4cad1024fff7 100644
--- a/Documentation/block/null_blk.txt
+++ b/Documentation/block/null_blk.txt
@@ -88,7 +88,8 @@ shared_tags=[0/1]: Default: 0
 
 zoned=[0/1]: Default: 0
   0: Block device is exposed as a random-access block device.
-  1: Block device is exposed as a host-managed zoned block device.
+  1: Block device is exposed as a host-managed zoned block device. Requires
+     CONFIG_BLK_DEV_ZONED.
 
 zone_size=[MB]: Default: 256
   Per zone size when exposed as a zoned block device. Must be a power of two.
diff --git a/drivers/block/null_blk.h b/drivers/block/null_blk.h
index b3df2793e7cd..cab4808f14bd 100644
--- a/drivers/block/null_blk.h
+++ b/drivers/block/null_blk.h
@@ -97,6 +97,7 @@ void null_zone_reset(struct nullb_cmd *cmd, sector_t sector);
 #else
 static inline int null_zone_init(struct nullb_device *dev)
 {
+	pr_err("CONFIG_BLK_DEV_ZONED not enabled\n");
 	return -EINVAL;
 }
 static inline void null_zone_exit(struct nullb_device *dev) {}
-- 
2.17.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] null_blk: add zoned config support information
  2019-01-04 17:06 [PATCH v2] null_blk: add zoned config support information John Pittman
@ 2019-01-04 21:49 ` Bart Van Assche
  2019-01-05 12:44   ` John Pittman
  0 siblings, 1 reply; 4+ messages in thread
From: Bart Van Assche @ 2019-01-04 21:49 UTC (permalink / raw)
  To: John Pittman, axboe; +Cc: linux-block, loberman

On Fri, 2019-01-04 at 12:06 -0500, John Pittman wrote:
+AD4 If the kernel is built without CONFIG+AF8-BLK+AF8-DEV+AF8-ZONED, a modprobe
+AD4 of the null+AF8-blk driver with zoned+AD0-1 fails with 'Invalid argument'.
+AD4 This can be confusing to users, prompting a search as to why the
+AD4 parameter is invalid. To assist in that search, add a bit more
+AD4 information to the failure, additionally adding to the documentation
+AD4 that CONFIG+AF8-BLK+AF8-DEV+AF8-ZONED is needed for zoned+AD0-1.
+AD4 
+AD4 Signed-off-by: John Pittman +ADw-jpittman+AEA-redhat.com+AD4
+AD4 ---
+AD4  Documentation/block/null+AF8-blk.txt +AHw 3 +-+--
+AD4  drivers/block/null+AF8-blk.h         +AHw 1 +-
+AD4  2 files changed, 3 insertions(+-), 1 deletion(-)
+AD4 
+AD4 diff --git a/Documentation/block/null+AF8-blk.txt b/Documentation/block/null+AF8-blk.txt
+AD4 index ea2dafe49ae8..4cad1024fff7 100644
+AD4 --- a/Documentation/block/null+AF8-blk.txt
+AD4 +-+-+- b/Documentation/block/null+AF8-blk.txt
+AD4 +AEAAQA -88,7 +-88,8 +AEAAQA shared+AF8-tags+AD0AWw-0/1+AF0: Default: 0
+AD4  
+AD4  zoned+AD0AWw-0/1+AF0: Default: 0
+AD4    0: Block device is exposed as a random-access block device.
+AD4 -  1: Block device is exposed as a host-managed zoned block device.
+AD4 +-  1: Block device is exposed as a host-managed zoned block device. Requires
+AD4 +-     CONFIG+AF8-BLK+AF8-DEV+AF8-ZONED.
+AD4  
+AD4  zone+AF8-size+AD0AWw-MB+AF0: Default: 256
+AD4    Per zone size when exposed as a zoned block device. Must be a power of two.
+AD4 diff --git a/drivers/block/null+AF8-blk.h b/drivers/block/null+AF8-blk.h
+AD4 index b3df2793e7cd..cab4808f14bd 100644
+AD4 --- a/drivers/block/null+AF8-blk.h
+AD4 +-+-+- b/drivers/block/null+AF8-blk.h
+AD4 +AEAAQA -97,6 +-97,7 +AEAAQA void null+AF8-zone+AF8-reset(struct nullb+AF8-cmd +ACo-cmd, sector+AF8-t sector)+ADs
+AD4  +ACM-else
+AD4  static inline int null+AF8-zone+AF8-init(struct nullb+AF8-device +ACo-dev)
+AD4  +AHs
+AD4 +-	pr+AF8-err(+ACI-CONFIG+AF8-BLK+AF8-DEV+AF8-ZONED not enabled+AFw-n+ACI)+ADs
+AD4  	return -EINVAL+ADs
+AD4  +AH0
+AD4  static inline void null+AF8-zone+AF8-exit(struct nullb+AF8-device +ACo-dev) +AHsAfQ

Reviewed-by: Bart Van Assche +ADw-bvanassche+AEA-acm.org+AD4


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] null_blk: add zoned config support information
  2019-01-04 21:49 ` Bart Van Assche
@ 2019-01-05 12:44   ` John Pittman
  2019-01-06 17:58     ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: John Pittman @ 2019-01-05 12:44 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: Jens Axboe, linux-block, Laurence Oberman

Jens, Bart, It occurred to me just now that on the pr_err() message,
"null_blk: CONFIG_BLK_DEV_ZONED not enabled" is a little better
than "CONFIG_BLK_DEV_ZONED not enabled".  It was my intent
to include that 'null_blk:', but it slipped my mind at the last moment.

On Fri, Jan 4, 2019 at 4:49 PM Bart Van Assche <bvanassche@acm.org> wrote:
>
> On Fri, 2019-01-04 at 12:06 -0500, John Pittman wrote:
> > If the kernel is built without CONFIG_BLK_DEV_ZONED, a modprobe
> > of the null_blk driver with zoned=1 fails with 'Invalid argument'.
> > This can be confusing to users, prompting a search as to why the
> > parameter is invalid. To assist in that search, add a bit more
> > information to the failure, additionally adding to the documentation
> > that CONFIG_BLK_DEV_ZONED is needed for zoned=1.
> >
> > Signed-off-by: John Pittman <jpittman@redhat.com>
> > ---
> >  Documentation/block/null_blk.txt | 3 ++-
> >  drivers/block/null_blk.h         | 1 +
> >  2 files changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/Documentation/block/null_blk.txt b/Documentation/block/null_blk.txt
> > index ea2dafe49ae8..4cad1024fff7 100644
> > --- a/Documentation/block/null_blk.txt
> > +++ b/Documentation/block/null_blk.txt
> > @@ -88,7 +88,8 @@ shared_tags=[0/1]: Default: 0
> >
> >  zoned=[0/1]: Default: 0
> >    0: Block device is exposed as a random-access block device.
> > -  1: Block device is exposed as a host-managed zoned block device.
> > +  1: Block device is exposed as a host-managed zoned block device. Requires
> > +     CONFIG_BLK_DEV_ZONED.
> >
> >  zone_size=[MB]: Default: 256
> >    Per zone size when exposed as a zoned block device. Must be a power of two.
> > diff --git a/drivers/block/null_blk.h b/drivers/block/null_blk.h
> > index b3df2793e7cd..cab4808f14bd 100644
> > --- a/drivers/block/null_blk.h
> > +++ b/drivers/block/null_blk.h
> > @@ -97,6 +97,7 @@ void null_zone_reset(struct nullb_cmd *cmd, sector_t sector);
> >  #else
> >  static inline int null_zone_init(struct nullb_device *dev)
> >  {
> > +     pr_err("CONFIG_BLK_DEV_ZONED not enabled\n");
> >       return -EINVAL;
> >  }
> >  static inline void null_zone_exit(struct nullb_device *dev) {}
>
> Reviewed-by: Bart Van Assche <bvanassche@acm.org>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] null_blk: add zoned config support information
  2019-01-05 12:44   ` John Pittman
@ 2019-01-06 17:58     ` Jens Axboe
  0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2019-01-06 17:58 UTC (permalink / raw)
  To: John Pittman, Bart Van Assche; +Cc: linux-block, Laurence Oberman

On 1/5/19 5:44 AM, John Pittman wrote:
> Jens, Bart, It occurred to me just now that on the pr_err() message,
> "null_blk: CONFIG_BLK_DEV_ZONED not enabled" is a little better
> than "CONFIG_BLK_DEV_ZONED not enabled".  It was my intent
> to include that 'null_blk:', but it slipped my mind at the last moment.

I applied it just now, and added the prefix to the error message.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-04 17:06 [PATCH v2] null_blk: add zoned config support information John Pittman
2019-01-04 21:49 ` Bart Van Assche
2019-01-05 12:44   ` John Pittman
2019-01-06 17:58     ` Jens Axboe

Linux-Block Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-block/0 linux-block/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-block linux-block/ https://lore.kernel.org/linux-block \
		linux-block@vger.kernel.org linux-block@archiver.kernel.org
	public-inbox-index linux-block


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-block


AGPL code for this site: git clone https://public-inbox.org/ public-inbox