Re: [PATCH] loop: Add regression test for unsupported backing file fallocate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/13/24 09:40, Cyril Hrubis wrote:
> From: Cyril Hrubis <chrubis@xxxxxxx>
>
> Signed-off-by: Cyril Hrubis <chrubis@xxxxxxx>

thanks for the test, little detail about the issue in the commit
log is always helpful in long run ...

[...]

> +test() {
> +	local loop_dev;
> +	echo "Running ${TEST_NAME}"
> +
> +	mkdir "$TMPDIR/tmpfs"
> +	mount -t tmpfs testfs "$TMPDIR/tmpfs"
> +	dd if=/dev/zero of="$TMPDIR/tmpfs/disk.img" bs=1M count=100 &> /dev/null
> +
> +	if ! loop_dev="$(losetup -f --show "$TMPDIR/tmpfs/disk.img")"; then
> +		return 1
> +	fi
> +
> +	mkfs.ext2 /dev/loop0 &> /dev/null
> +
> +	errors=$(_dmesg_since_test_start |grep "operation not supported error, dev" |wc -l)

nit:- can we use grep -c by any chance instead of wc -l ?

errors=$(_dmesg_since_test_start | grep -c "operation not supported 
error, dev")

if not please ignore this comment ...

> +
> +	losetup -d "$loop_dev"
> +	umount "$TMPDIR/tmpfs"
> +
> +	echo "Found $errors error(s) in dmesg"
> +
> +	echo "Test complete"
> +}
>

we are looking for REQ_OP_WRITE_ZEORES failure i.e. string 
"WRITE_ZEROES" on the
loop device "loop0" that will come from :

blk_complete_reqs()
  blk_mq_end_request()
   blk_update_request()
    blk_print_req_error()
     blk_op_str() <---

else we might take random errors into consideration that are not related to
write-zeroes and loop0 ?

other than this it looks good to me ...

-ck






[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux