Skip to contentSkip to conversation

translators: fix io.d.in devinfo_t.dev_{statname,pathname}

PATCH New Nick Alcock 1 participant 1 message Jan 21, 2025

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 translators: fix io.d.in devinfo_t.dev_{statname,pathname}

A precedence problem caused us to never accurately determine that a partitionless device was partitionless, producing erroneous names like "loop00" for conventional loop devices, etc.

Fixed thusly: translators above 5.12 need regenerating.

Fixes test/unittest/io/tst.{local,wait}.sh.

---
 libdtrace/io.d.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libdtrace/io.d.in +1 -1
index f44f53f092dce..09915dbceafa2 100644
@@ -135,7 +135,7 @@ translator devinfo_t < struct bio *B > {
 					getmajor(B->__bio_part_dev) % 255
 				   ]->name);
 	dev_statname = B->__disk_chk == NULL ? "nfs" :
-	    B->__bio_partno == 0 ? stringof(B->__disk->disk_name) :
+	    (B->__bio_partno) == 0 ? stringof(B->__disk->disk_name) :
 	    strjoin(stringof(B->__disk->disk_name), lltostr(B->__bio_partno));
 	dev_pathname = B->__disk_chk == NULL ? "<nfs>" : "<unknown>";
 };

base-commit: 0fd90283cc03c640de3695d5f276dd6289a022db

Signature · 1 line
2.47.1.279.g84c5f4e78e