[LTP] [PATCH v2 2/3] lib/tst_device.c: check for BTRFS_SUPER_MAGIC instead of device major of 0

Jeff Moyer jmoyer@redhat.com
Wed Feb 12 18:05:44 CET 2025


Hi, Petr,

Thanks a lot for the review.  I just have one question, below:

Petr Vorel <pvorel@suse.cz> writes:

>> @@ -595,8 +595,13 @@ void tst_find_backing_dev(const char *path, char *dev, size_t dev_size)
>>  	dev_minor = minor(buf.st_dev);
>>  	*dev = '\0';
>
>> -	if (dev_major == 0) {
>> +	if (statfs(path, &fsbuf) < 0)
>> +		tst_brkm(TWARN | TERRNO, NULL, "statfs() failed");
> Please use SAFE_STATFS() here.

SAFE_STATFS appears to be part of the new safe macros
(tst_safe_macros_inline.h), whereas tst_device.c includes the older
macros via #include "safe_macros.h".  How would you like me to proceed?
I could add a SAFE_STATFS to the old macros, or I could submit a prep
patch that converts tst_device to the new macros.  Or something else?

Thanks!
Jeff



More information about the ltp mailing list