[PATCH mtd-utils] fs-tests: integck: Allow checking root

Zhihao Cheng chengzhihao1 at huawei.com
Thu Aug 8 06:32:51 PDT 2024


在 2024/8/8 20:31, Csókás, Bence 写道:
> Trailing slash removal creates an empty string
> from '/', making it impossible to check the
> root filesystem.
> 

It will bring a new failed assertion 'CHECK(umount(fsinfo.mount_point) 
!= -1)' in recover_tested_fs(), following is the log:

integck: pid 3387, testing "ext4" at "/"
integck: error!: condition 'umount(fsinfo.mount_point) != -1' failed in 
recover_tested_fs() at tests/fs-tests/integrity/integck.c:3212
integck: error 16 (Device or resource busy)

> Signed-off-by: Csókás, Bence <csokas.bence at prolan.hu>
> ---
>   tests/fs-tests/integrity/integck.c | 8 +++++---
>   1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/fs-tests/integrity/integck.c b/tests/fs-tests/integrity/integck.c
> index 0a7f142..b7cedc2 100644
> --- a/tests/fs-tests/integrity/integck.c
> +++ b/tests/fs-tests/integrity/integck.c
> @@ -2946,9 +2946,11 @@ static void get_tested_fs_info(void)
>   	/* Remove trailing '/' symbols from the mount point */
>   	p = dup_string(args.mount_point);
>   	fsinfo.mount_point = p;
> -	p += strlen(p);
> -	while (*--p == '/');
> -	*(p + 1) = '\0';
> +	if (strlen(p) > 1) {
> +		p += strlen(p);
> +		while (*--p == '/');
> +		*(p + 1) = '\0';
> +	}
>   
>   	CHECK(statfs(fsinfo.mount_point, &fs_info) == 0);
>   	fsinfo.max_name_len = fs_info.f_namelen;
> 




More information about the linux-mtd mailing list