* Re: [PATCH v2] generic/108: fix test hand upon failure to create LV
2026-01-07 10:37 [PATCH v2] generic/108: fix test hand upon failure to create LV Ojaswin Mujoo
@ 2026-01-10 1:34 ` Darrick J. Wong
2026-01-13 11:10 ` Disha Goel
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Darrick J. Wong @ 2026-01-10 1:34 UTC (permalink / raw)
To: Ojaswin Mujoo; +Cc: Zorro Lang, fstests, Disha Goel
On Wed, Jan 07, 2026 at 04:07:44PM +0530, Ojaswin Mujoo wrote:
> In case the lvcreate operation fails, we don't catch the error and
> proceed as usual. The test then tries to wait for the LV to come up
> but it never does, causing a hang.
>
> To fix this:
> 1. Add a check to ensure SCSI_DEBUG dev is of required size
> 2. Additionally, fail if there are errors while creating the LV.
>
> Context for completeness:
>
> This was noticed when we accidentally used CONFIG_SCSI_DEBUG=y instead
> of =m, causing it to create an 8MB SCSI debug device. This led to the
> lvcreate operation to fail with:
>
> Insufficient suitable allocatable extents for logical volume lv_108: 68 more required
>
> However the test never caught this resulting in a hang.
>
> Signed-off-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
> Reported-by: Disha Goel <disgoel@linux.ibm.com>
Ooops. Yeah, I think it's a good idea to check the scsi_debug size and
to bail out if lvcreate fails.
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
--D
> ---
> tests/generic/108 | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/tests/generic/108 b/tests/generic/108
> index 4f86ec94..05d743a9 100755
> --- a/tests/generic/108
> +++ b/tests/generic/108
> @@ -50,6 +50,11 @@ SCSI_DEBUG_DEV=`_get_scsi_debug_dev ${physical:-512} ${logical:-512} 0 $size`
> test -b "$SCSI_DEBUG_DEV" || _notrun "Failed to initialize scsi debug device"
> echo "SCSI debug device $SCSI_DEBUG_DEV" >>$seqres.full
>
> +got_size_kb=$(_get_device_size $SCSI_DEBUG_DEV)
> +
> +[[ $got_size_kb -lt $((size * 1024)) ]] &&
> + _notrun "Need SCSI debug device of size $(( size * 1024 )) KB. Got $got_size_kb KB"
> +
> # create striped volume with 4MB stripe size
> #
> # lvm has a hardcoded list of valid devices and fails with
> @@ -60,7 +65,7 @@ $LVM_PROG vgcreate -f $vgname $SCSI_DEBUG_DEV $SCRATCH_DEV >>$seqres.full 2>&1
> # We use yes pipe instead of 'lvcreate --yes' because old version of lvm
> # (like 2.02.95 in RHEL6) don't support --yes option
> yes | $LVM_PROG lvcreate -i 2 -I 4m -L ${lvsize}m -n $lvname $vgname \
> - >>$seqres.full 2>&1
> + >>$seqres.full 2>&1 || _fail "Failed to create LVM lv"
> _udev_wait /dev/mapper/$vgname-$lvname
>
> # _mkfs_dev exits the test on failure, this makes sure test lv is created by
> --
> 2.51.0
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH v2] generic/108: fix test hand upon failure to create LV
2026-01-07 10:37 [PATCH v2] generic/108: fix test hand upon failure to create LV Ojaswin Mujoo
2026-01-10 1:34 ` Darrick J. Wong
@ 2026-01-13 11:10 ` Disha Goel
2026-01-13 16:02 ` Christoph Hellwig
2026-01-18 17:22 ` Zorro Lang
3 siblings, 0 replies; 5+ messages in thread
From: Disha Goel @ 2026-01-13 11:10 UTC (permalink / raw)
To: Ojaswin Mujoo, Zorro Lang, fstests
On 07/01/26 4:07 pm, Ojaswin Mujoo wrote:
> In case the lvcreate operation fails, we don't catch the error and
> proceed as usual. The test then tries to wait for the LV to come up
> but it never does, causing a hang.
>
> To fix this:
> 1. Add a check to ensure SCSI_DEBUG dev is of required size
> 2. Additionally, fail if there are errors while creating the LV.
>
> Context for completeness:
>
> This was noticed when we accidentally used CONFIG_SCSI_DEBUG=y instead
> of =m, causing it to create an 8MB SCSI debug device. This led to the
> lvcreate operation to fail with:
>
> Insufficient suitable allocatable extents for logical volume lv_108: 68 more required
>
> However the test never caught this resulting in a hang.
>
> Signed-off-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
> Reported-by: Disha Goel <disgoel@linux.ibm.com>
Looks good to me. The changes correctly handle the lvcreate failure
scenario and add a proper size check for the SCSI debug device,
preventing the hang we observed earlier. Tested successfully on my setup.
Tested-by & Reviewed-by: Disha Goel <disgoel@linux.ibm.com>
> ---
> tests/generic/108 | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/tests/generic/108 b/tests/generic/108
> index 4f86ec94..05d743a9 100755
> --- a/tests/generic/108
> +++ b/tests/generic/108
> @@ -50,6 +50,11 @@ SCSI_DEBUG_DEV=`_get_scsi_debug_dev ${physical:-512} ${logical:-512} 0 $size`
> test -b "$SCSI_DEBUG_DEV" || _notrun "Failed to initialize scsi debug device"
> echo "SCSI debug device $SCSI_DEBUG_DEV" >>$seqres.full
>
> +got_size_kb=$(_get_device_size $SCSI_DEBUG_DEV)
> +
> +[[ $got_size_kb -lt $((size * 1024)) ]] &&
> + _notrun "Need SCSI debug device of size $(( size * 1024 )) KB. Got $got_size_kb KB"
> +
> # create striped volume with 4MB stripe size
> #
> # lvm has a hardcoded list of valid devices and fails with
> @@ -60,7 +65,7 @@ $LVM_PROG vgcreate -f $vgname $SCSI_DEBUG_DEV $SCRATCH_DEV >>$seqres.full 2>&1
> # We use yes pipe instead of 'lvcreate --yes' because old version of lvm
> # (like 2.02.95 in RHEL6) don't support --yes option
> yes | $LVM_PROG lvcreate -i 2 -I 4m -L ${lvsize}m -n $lvname $vgname \
> - >>$seqres.full 2>&1
> + >>$seqres.full 2>&1 || _fail "Failed to create LVM lv"
> _udev_wait /dev/mapper/$vgname-$lvname
>
> # _mkfs_dev exits the test on failure, this makes sure test lv is created by
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH v2] generic/108: fix test hand upon failure to create LV
2026-01-07 10:37 [PATCH v2] generic/108: fix test hand upon failure to create LV Ojaswin Mujoo
2026-01-10 1:34 ` Darrick J. Wong
2026-01-13 11:10 ` Disha Goel
@ 2026-01-13 16:02 ` Christoph Hellwig
2026-01-18 17:22 ` Zorro Lang
3 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2026-01-13 16:02 UTC (permalink / raw)
To: Ojaswin Mujoo; +Cc: Zorro Lang, fstests, Disha Goel
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] generic/108: fix test hand upon failure to create LV
2026-01-07 10:37 [PATCH v2] generic/108: fix test hand upon failure to create LV Ojaswin Mujoo
` (2 preceding siblings ...)
2026-01-13 16:02 ` Christoph Hellwig
@ 2026-01-18 17:22 ` Zorro Lang
3 siblings, 0 replies; 5+ messages in thread
From: Zorro Lang @ 2026-01-18 17:22 UTC (permalink / raw)
To: Ojaswin Mujoo; +Cc: fstests, Disha Goel
On Wed, Jan 07, 2026 at 04:07:44PM +0530, Ojaswin Mujoo wrote:
> In case the lvcreate operation fails, we don't catch the error and
> proceed as usual. The test then tries to wait for the LV to come up
> but it never does, causing a hang.
>
> To fix this:
> 1. Add a check to ensure SCSI_DEBUG dev is of required size
> 2. Additionally, fail if there are errors while creating the LV.
>
> Context for completeness:
>
> This was noticed when we accidentally used CONFIG_SCSI_DEBUG=y instead
> of =m, causing it to create an 8MB SCSI debug device. This led to the
> lvcreate operation to fail with:
>
> Insufficient suitable allocatable extents for logical volume lv_108: 68 more required
>
> However the test never caught this resulting in a hang.
>
> Signed-off-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
> Reported-by: Disha Goel <disgoel@linux.ibm.com>
> ---
Thanks for re-sending this V2, this version looks good to me now.
Reviewed-by: Zorro Lang <zlang@redhat.com>
> tests/generic/108 | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/tests/generic/108 b/tests/generic/108
> index 4f86ec94..05d743a9 100755
> --- a/tests/generic/108
> +++ b/tests/generic/108
> @@ -50,6 +50,11 @@ SCSI_DEBUG_DEV=`_get_scsi_debug_dev ${physical:-512} ${logical:-512} 0 $size`
> test -b "$SCSI_DEBUG_DEV" || _notrun "Failed to initialize scsi debug device"
> echo "SCSI debug device $SCSI_DEBUG_DEV" >>$seqres.full
>
> +got_size_kb=$(_get_device_size $SCSI_DEBUG_DEV)
> +
> +[[ $got_size_kb -lt $((size * 1024)) ]] &&
> + _notrun "Need SCSI debug device of size $(( size * 1024 )) KB. Got $got_size_kb KB"
> +
> # create striped volume with 4MB stripe size
> #
> # lvm has a hardcoded list of valid devices and fails with
> @@ -60,7 +65,7 @@ $LVM_PROG vgcreate -f $vgname $SCSI_DEBUG_DEV $SCRATCH_DEV >>$seqres.full 2>&1
> # We use yes pipe instead of 'lvcreate --yes' because old version of lvm
> # (like 2.02.95 in RHEL6) don't support --yes option
> yes | $LVM_PROG lvcreate -i 2 -I 4m -L ${lvsize}m -n $lvname $vgname \
> - >>$seqres.full 2>&1
> + >>$seqres.full 2>&1 || _fail "Failed to create LVM lv"
> _udev_wait /dev/mapper/$vgname-$lvname
>
> # _mkfs_dev exits the test on failure, this makes sure test lv is created by
> --
> 2.51.0
>
^ permalink raw reply [flat|nested] 5+ messages in thread