[LTP] [PATCH v2] tst_find_backing_dev: match mount point if major/minor can't be found

Cyril Hrubis chrubis@suse.cz
Tue May 17 17:33:04 CEST 2022


Hi!
> +		len = count_match_len(path, mnt_point);
> +		if (len > best_match_len) {

I wonder if we should also check for minimal len to avoid trival prefix
matches such as "/". Maybe we should set the best_match_len to 1 to
begin with.

> +			strcpy(dev, pre);
> +			best_match_len = len;
> +		}
>  	}
>  
>  	SAFE_FCLOSE(NULL, file);
> -- 
> 2.27.0
> 
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list