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

Petr Vorel pvorel@suse.cz
Wed Feb 12 21:10:47 CET 2025


Hi Jeff,

> 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?

I'm sorry to overlook this. Your original is perfect then.

Kind regards,
Petr

> Thanks!
> Jeff



More information about the ltp mailing list