public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <chaitanyak@nvidia.com>
To: Josef Bacik <josef@toxicpanda.com>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"bvanassche@acm.org" <bvanassche@acm.org>
Subject: Re: Nullblk configfs oddities
Date: Mon, 18 Apr 2022 21:54:12 +0000	[thread overview]
Message-ID: <c7f02531-8637-89a2-d8b7-1da03240db73@nvidia.com> (raw)
In-Reply-To: <Yl3aQQtPQvkskXcP@localhost.localdomain>

On 4/18/22 14:38, Josef Bacik wrote:
> Hello,
> 
> I'm trying to add a test to fsperf and it requires the use of nullblk.  I'm
> trying to use the configfs thing, and it's doing some odd things.  My basic
> reproducer is
> 
> modprobe null_blk
> mkdir /sys/kernel/config/nullb/nullb0
> echo some shit into the config
> echo 1 > /sys/kernel/config/nullb/nullb0/power
> 
> Now null_blk apparently defaults to nr_devices == 1, so it creates nullb0 on
> modprobe.  But this doesn't show up in the configfs directory.  There's no way
> to find this out until when I try to mkfs my nullb0 and it doesn't work.  The
> above steps gets my device created at /dev/nullb1, but there's no actual way to
> figure out that's what happened.  If I do something like
> /sys/kernel/config/nullb/nullbfsperf I still just get nullb<number>, I don't get
> my fancy name.
> 

when you load module with default module parameter it will create a 
default device with no memory backed mode, that will not be visible in 
the configfs.

So you need to load the module with nr_devices=0 that will prevent the 
null_blk to create the default device which is not memory backed and not 
present in the configfs:-

linux-block (for-next) # modprobe null_blk
linux-block (for-next) # lsblk
NAME    MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda       8:0    0   50G  0 disk
├─sda1    8:1    0    1G  0 part /boot
└─sda2    8:2    0   49G  0 part /home
sdb       8:16   0  100G  0 disk /mnt/data
sr0      11:0    1 1024M  0 rom
nullb0  250:0    0  250G  0 disk <-------------------
zram0   251:0    0    8G  0 disk [SWAP]
vda     252:0    0  512M  0 disk
nvme0n1 259:0    0    1G  0 disk
linux-block (for-next) # tree config
config
└── nullb
     └── features

1 directory, 1 file
linux-block (for-next) # modprobe  -r null_blk
linux-block (for-next) # modprobe null_blk nr_devices=0
linux-block (for-next) # lsblk
NAME    MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda       8:0    0   50G  0 disk
├─sda1    8:1    0    1G  0 part /boot
└─sda2    8:2    0   49G  0 part /home
sdb       8:16   0  100G  0 disk /mnt/data
sr0      11:0    1 1024M  0 rom
zram0   251:0    0    8G  0 disk [SWAP]
vda     252:0    0  512M  0 disk
nvme0n1 259:0    0    1G  0 disk
linux-block (for-next) # tree config
config
└── nullb
     └── features

1 directory, 1 file
linux-block (for-next) #

-ck


  reply	other threads:[~2022-04-18 21:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-18 21:38 Nullblk configfs oddities Josef Bacik
2022-04-18 21:54 ` Chaitanya Kulkarni [this message]
2022-04-18 22:02   ` Josef Bacik
2022-04-18 22:15     ` Chaitanya Kulkarni
2022-04-18 22:14   ` Jens Axboe
2022-04-18 22:21     ` Chaitanya Kulkarni
2022-04-18 22:24       ` Jens Axboe
2022-04-18 22:28         ` Josef Bacik
2022-04-19  4:23         ` Damien Le Moal
2022-04-19 14:49           ` Bart Van Assche
2022-05-03 20:20           ` Josef Bacik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c7f02531-8637-89a2-d8b7-1da03240db73@nvidia.com \
    --to=chaitanyak@nvidia.com \
    --cc=bvanassche@acm.org \
    --cc=josef@toxicpanda.com \
    --cc=linux-block@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox