From: Petr Vorel <pvorel@suse.cz>
To: Jeff Moyer <jmoyer@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v3 2/3] lib/tst_device.c: check for BTRFS_SUPER_MAGIC instead of device major of 0
Date: Tue, 18 Feb 2025 13:50:29 +0100 [thread overview]
Message-ID: <20250218125029.GB2469726@pevik> (raw)
In-Reply-To: <20250217215038.177250-3-jmoyer@redhat.com>
Hi Jeff,
> stat() may return a major number of 0 in st_dev for any number of
> pseudo file systems. Check for the exact file system instead. There
> should be no change in behavior with this patch.
LGTM, thank you!
Reviewed-by: Petr Vorel <pvorel@suse.cz>
FYI I'll apply very minor formatting fix before merge.
Kind regards,
Petr
+++ lib/tst_device.c
@@ -559,12 +559,10 @@ static void btrfs_get_uevent_path(char *tmp_path, char *uevent_path)
uevent_path[0] = '\0';
- if (d) {
- sprintf(uevent_path, "%s/%s/uevent",
- bdev_path, d->d_name);
- } else {
- tst_brkm(TBROK | TERRNO, NULL, "No backing device found while looking in %s.", bdev_path);
- }
+ if (d)
+ sprintf(uevent_path, "%s/%s/uevent", bdev_path, d->d_name);
+ else
+ tst_brkm(TBROK | TERRNO, NULL, "No backing device found while looking in %s", bdev_path);
if (SAFE_READDIR(NULL, dir))
tst_resm(TINFO, "Warning: used first of multiple backing device.");
@@ -600,7 +598,7 @@ void tst_find_backing_dev(const char *path, char *dev, size_t dev_size)
if (fsbuf.f_type == TST_BTRFS_MAGIC) {
btrfs_get_uevent_path(tmp_path, uevent_path);
} else if (dev_major == 0) {
- tst_brkm(TBROK, NULL, "%s resides on an unsupported pseudo-file system.", path);
+ tst_brkm(TBROK, NULL, "%s resides on an unsupported pseudo-file system", path);
} else {
tst_resm(TINFO, "Use uevent strategy");
sprintf(uevent_path,
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2025-02-18 12:51 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-17 21:46 [LTP] [PATCH v3 0/3] tst_device: add support for overlayfs Jeff Moyer
2025-02-17 21:46 ` [LTP] [PATCH v3 1/3] lib/tst_device.c: factor out btrfs-specific logic from tst_find_backing_dev Jeff Moyer
2025-02-20 10:23 ` Cyril Hrubis
2025-02-17 21:46 ` [LTP] [PATCH v3 2/3] lib/tst_device.c: check for BTRFS_SUPER_MAGIC instead of device major of 0 Jeff Moyer
2025-02-18 12:50 ` Petr Vorel [this message]
2025-02-18 19:54 ` Jeff Moyer
2025-02-20 10:24 ` Cyril Hrubis
2025-02-20 11:53 ` Petr Vorel
2025-02-17 21:46 ` [LTP] [PATCH v3 3/3] tst_find_backing_dev(): add support for overlayfs Jeff Moyer
2025-02-18 12:57 ` Petr Vorel
2025-02-18 20:01 ` Jeff Moyer
2025-02-20 4:12 ` Petr Vorel
2025-02-20 11:15 ` Cyril Hrubis
2025-03-04 21:15 ` Jeff Moyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250218125029.GB2469726@pevik \
--to=pvorel@suse.cz \
--cc=jmoyer@redhat.com \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox