From 2d872fec8c3d69b7c8bed0fb56c1ce4860465262 Mon Sep 17 00:00:00 2001 From: Anand Jain Date: Tue, 2 May 2023 19:39:34 +0800 Subject: [PATCH] btrfs-progs: tests/nullb fix kernel support check I have a setup where null_blk is not a module but is built-in, so to check if the kernel supports null_blk, use 'modinfo -n'. Also fix a comment. Signed-off-by: Anand Jain Signed-off-by: David Sterba --- tests/nullb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/nullb b/tests/nullb index 3fda4a2b..bffa9f33 100755 --- a/tests/nullb +++ b/tests/nullb @@ -8,7 +8,7 @@ # - load required modules and mount configfs # # nullb create [-s size] [-z zonesize] -# - create a new device with given sizes, allocating the first free indes, # +# - create a new device with given sizes, allocating the first free index, # device is /dev/nullb$index # # nullb ls @@ -51,8 +51,8 @@ function _dbg() { } function _check_setup() { - if ! grep -q null_blk /proc/modules; then - _error "module not loaded" + if ! modinfo -n null_blk > /dev/null; then + _error "module not compiled/loaded" fi if ! grep -q configfs /proc/filesystems; then _error "configfs not mounted"