Re: [PATCH v3 1/3] btrfs: test btrfs specific fsverity corruption

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



On Thu, Apr 08, 2021 at 11:57:49AM -0700, Boris Burkov wrote:
> +get_ino() {
> +	file=$1
> +	ls -i $file | awk '{print $1}'
> +}

Please use 'local' when declaring variables in shell functions.

> +# corrupt the data portion of an inline extent
> +corrupt_inline() {
> +	f=$SCRATCH_MNT/inl
> +	head -c 42 /dev/zero | tr '\0' X > $f
> +	ino=$(get_ino $f)
> +	_fsv_enable $f
> +	$XFS_IO_PROG -c sync $SCRATCH_MNT
> +	_scratch_unmount

Isn't the sync unnecessary because the filesystem is unmounted anyway?

Likewise for all the other corrupt_* functions.

Otherwise, at a high level this test looks good -- thanks for writing it!

- Eric



[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux