From 80aa3d4927bb0f894bdcacd1655b7f90de6ba6b5 Mon Sep 17 00:00:00 2001 From: Ken McDonell Date: Fri, 23 Feb 2024 13:38:42 +1100 Subject: [PATCH 1/3] src/pmdas/linux/filesys.c: add UUID support for Device Mapper block devices Thanks to Marko for pointing this out. The previous code failed to match the UUID a Device Mapper block device (e.g. /dev/dm-0) with the corresponding Device Mapper name (e.g. /dev/mapper/fedora_vm22-root). --- src/pmdas/linux/filesys.c | 94 +++++++++++++++++++++++++++++++-------- src/pmdas/linux/filesys.h | 1 + 2 files changed, 77 insertions(+), 18 deletions(-) diff --git a/src/pmdas/linux/filesys.c b/src/pmdas/linux/filesys.c index 12a2a19634..583b704daf 100644 --- a/src/pmdas/linux/filesys.c +++ b/src/pmdas/linux/filesys.c @@ -106,12 +106,41 @@ do_uuids(pmInDom filesys_indom) if (sts != PMDA_CACHE_ACTIVE) { /* * this is a block device that has a UUID, but is not a - * mounted filesystem ... either swap device or an unmounted - * filesystem, so ignore it + * mounted filesystem ... either swap device or an + * unmounted filesystem or possibly a Device Mapper device + * ... in the latter case we need to search the InDom + * cache to see if the current "device" matches the name + * of a dm_device. + * + * if this fails, just ignore this one (there will be no + * UUID to report). */ + fs = NULL; if (pmDebugOptions.appl8) - fprintf(stderr, "do_uuids: Warning: disk %s not in InDom Cache\n", device); - continue; + fprintf(stderr, "do_uuids: Warning: device %s not in InDom Cache\n", device); + if ((sts = pmdaCacheOp(filesys_indom, PMDA_CACHE_WALK_REWIND)) < 0) { + if (pmDebugOptions.appl8) + fprintf(stderr, "do_uuids: Botch: pmdaCacheOp(.., PMDA_CACHE_WALK_REWIND) failed: %s\n", pmErrStr(sts)); + continue; + } + /* InDom cache walk ... */ + for ( ; ; ) { + if ((sts = pmdaCacheOp(filesys_indom, PMDA_CACHE_WALK_NEXT)) < 0) { + fs = NULL; + break; + } + if (pmdaCacheLookup(filesys_indom, sts, NULL, (void **)&fs) != PMDA_CACHE_ACTIVE) + continue; + if (fs != NULL && fs->dm_device != NULL && + strcmp(device, fs->dm_device) == 0) + /* match dm_device for a different device */ + break; + } + if (fs == NULL) { + if (pmDebugOptions.appl8) + fprintf(stderr, "do_uuids: Warning: dm_device %s not in InDom Cache\n", device); + continue; + } } if (fs->uuid == NULL) { /* @@ -119,8 +148,10 @@ do_uuids(pmInDom filesys_indom) */ fs->uuid = strdup(dep->d_name); if (pmDebugOptions.appl8) { - fprintf(stderr, "do_uuids: add \"%s\" \"%s\"\n", - device, fs->uuid); + fprintf(stderr, "do_uuids: add device \"%s\"", fs->device); + if (fs->dm_device != NULL) + fprintf(stderr, " dm_device \"%s\"", fs->dm_device); + fprintf(stderr, " uuid \"%s\"\n", fs->uuid); } } else if (strcmp(fs->uuid, dep->d_name) != 0) { @@ -130,8 +161,10 @@ do_uuids(pmInDom filesys_indom) free(fs->uuid); fs->uuid = strdup(dep->d_name); if (pmDebugOptions.appl8) { - fprintf(stderr, "do_uuids: change \"%s\" \"%s\"\n", - device, fs->uuid); + fprintf(stderr, "do_uuids: change device \"%s\"", fs->device); + if (fs->dm_device != NULL) + fprintf(stderr, " dm_device \"%s\"", fs->dm_device); + fprintf(stderr, " uuid \"%s\"\n", fs->uuid); } } } @@ -145,13 +178,16 @@ int refresh_filesys(pmInDom filesys_indom, pmInDom tmpfs_indom, struct linux_container *cp) { - char buf[MAXPATHLEN]; - char src[MAXPATHLEN]; - filesys_t *fs; - pmInDom indom; - FILE *fp; - char *path, *device, *type, *options; - int sts; + char buf[MAXPATHLEN]; + char src[MAXPATHLEN]; + filesys_t *fs; + pmInDom indom; + FILE *fp; + char *path, *device, *type, *options; + char *devname; + char link[MAXPATHLEN]; + ssize_t len; + int sts; pmdaCacheOp(tmpfs_indom, PMDA_CACHE_INACTIVE); pmdaCacheOp(filesys_indom, PMDA_CACHE_INACTIVE); @@ -196,7 +232,7 @@ refresh_filesys(pmInDom filesys_indom, pmInDom tmpfs_indom, continue; /* keep dm and md persistent names, RHBZ#1349932 */ - if (strncmp(device, "/dev/mapper", 11) != 0 && strncmp(device, "/dev/md", 7) != 0) { + if (strncmp(device, "/dev/mapper/", 12) != 0 && strncmp(device, "/dev/md/", 8) != 0) { if (realpath(device, src) != NULL) device = src; } @@ -221,10 +257,32 @@ refresh_filesys(pmInDom filesys_indom, pmInDom tmpfs_indom, fs->device = strdup(device); fs->path = strdup(path); fs->options = strdup(options); + fs->dm_device = NULL; + if (strncmp(device, "/dev/mapper/", 12) == 0) { + char tmp[MAXPATHLEN]; + pmsprintf(tmp, sizeof(tmp), "%s/%s", linux_statspath, device); + len = readlink(tmp, link, sizeof(link)-1); + if (len < 0) { + /* + * should never happen, unless /dev/mapper is borked + */ + if (pmDebugOptions.appl8) + fprintf(stderr, "do_uuids: readlink(%s) failed: %s\n", tmp, pmErrStr(-oserror())); + } + else { + link[len] = '\0'; + devname = rindex(link, '/'); + pmsprintf(src, sizeof(src), "/dev%s", devname); + fs->dm_device = strdup(src); + } + } fs->uuid = NULL; if (pmDebugOptions.appl8) { - fprintf(stderr, "refresh_filesys: add \"%s\" \"%s\"\n", - fs->path, device); + fprintf(stderr, "refresh_filesys: add mount \"%s\" device \"%s\"", + fs->path, fs->device); + if (fs->dm_device != NULL) + fprintf(stderr, " dm_device \"%s\"", fs->dm_device); + fputc('\n', stderr); } pmdaCacheStore(indom, PMDA_CACHE_ADD, device, fs); } diff --git a/src/pmdas/linux/filesys.h b/src/pmdas/linux/filesys.h index 056e67bdfc..eb552e0c2f 100644 --- a/src/pmdas/linux/filesys.h +++ b/src/pmdas/linux/filesys.h @@ -23,6 +23,7 @@ typedef struct filesys { int id; unsigned int flags; char *device; + char *dm_device; /* corresponding device mapper device */ char *path; char *options; char *uuid; From 1807ae624c55150bef235394a27e66f533d42f0f Mon Sep 17 00:00:00 2001 From: Ken McDonell Date: Fri, 23 Feb 2024 13:41:40 +1100 Subject: [PATCH 2/3] qa/new-grind: add missing quotes in generated $PCPQA_VALGRIND test --- qa/new-grind | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qa/new-grind b/qa/new-grind index 10ad3c9f00..ad567439af 100755 --- a/qa/new-grind +++ b/qa/new-grind @@ -177,7 +177,7 @@ NF == 1 && $1 == "#" && done == 0 { { print } /^ *do_valgrind=true/ { print "elif which valgrind >/dev/null 2>&1" print "then" - print " [ $PCPQA_VALGRIND = both ] || \\" + print " [ \"$PCPQA_VALGRIND\" = both ] || \\" print " _notrun \"valgrind variant qa/'$newseq' will be run\"" next }' From d1cef72995a0ae3a9ddb92e1f1962d72f4496615 Mon Sep 17 00:00:00 2001 From: Ken McDonell Date: Fri, 23 Feb 2024 13:59:04 +1100 Subject: [PATCH 3/3] linux PMDA: filesys.uuid updates - cull boring and useless diagnostic from PMDA - extend QA to cover Device Mapper cases --- qa/1485 | 44 ++++- qa/1485.out | 148 ++++++++++----- qa/1487.out | 184 ++++++++++++++----- qa/linux/mk.uuid | 21 ++- qa/linux/{uuid-root.tgz => uuid-00-root.tgz} | Bin qa/linux/uuid-01-root.tgz | Bin 0 -> 1251 bytes src/pmdas/linux/filesys.c | 5 +- 7 files changed, 301 insertions(+), 101 deletions(-) rename qa/linux/{uuid-root.tgz => uuid-00-root.tgz} (100%) create mode 100644 qa/linux/uuid-01-root.tgz diff --git a/qa/1485 b/qa/1485 index a8ef1704fb..d72daa76ec 100755 --- a/qa/1485 +++ b/qa/1485 @@ -31,7 +31,7 @@ then do_valgrind=true elif which valgrind >/dev/null 2>&1 then - [ $PCPQA_VALGRIND = both ] || \ + [ "$PCPQA_VALGRIND" = both ] || \ _notrun "valgrind variant qa/1487 will be run" fi @@ -69,13 +69,15 @@ inerr == 0 { print >"'"$tmp.out"'" }' } mkdir -p $tmp/root -cd $tmp/root -$sudo tar zxpf $here/linux/uuid-root.tgz -cd $here export LINUX_STATSPATH=$tmp/root # real QA test starts here +echo "+++ uuid-00 tarball +++" +cd $tmp/root +$sudo tar zxpf $here/linux/uuid-00-root.tgz +cd $here + echo "situation normal ..." DEBUG='' _doit @@ -84,6 +86,7 @@ echo echo "cull some mounts ..." grep -v '/dev/sd[bd]' <$LINUX_STATSPATH/proc/self/mounts >$tmp.tmp $sudo cp $tmp.tmp $LINUX_STATSPATH/proc/self/mounts +DEBUG='' _doit echo @@ -101,11 +104,44 @@ _doit echo echo "/dev/disk/by-uuid empty ..." rm -f $LINUX_STATSPATH/dev/disk/by-uuid/* +DEBUG='-Dappl8' _doit echo echo "/dev/disk/by-uuid missing ..." rm -rf $LINUX_STATSPATH/dev/disk/by-uuid +DEBUG='-Dappl8' +_doit + +echo +echo "+++ uuid-01 tarball +++" +cd $tmp/root +$sudo tar zxpf $here/linux/uuid-01-root.tgz +cd $here + +echo "situation normal ..." +DEBUG='' +_doit + +echo +echo "/dev/mapper empty ..." +$sudo rm -f $LINUX_STATSPATH/dev/mapper/* +DEBUG='-Dappl8' +_doit + +echo +echo "/dev/mapper is bogus ..." +cd $LINUX_STATSPATH/dev/mapper +$sudo ln -s ../dm-13 fedora_vm22-root +$sudo touch fedora_vm22-swap +cd $here +DEBUG='-Dappl8' +_doit + +echo +echo "/dev/mapper missing ..." +$sudo rm -rf $LINUX_STATSPATH/dev/mapper +DEBUG='-Dappl8' _doit # success, all done diff --git a/qa/1485.out b/qa/1485.out index c4b4bfa0e3..9f26875a01 100644 --- a/qa/1485.out +++ b/qa/1485.out @@ -1,4 +1,5 @@ QA output created by 1485 ++++ uuid-00 tarball +++ situation normal ... filesys.mountdir @@ -60,32 +61,32 @@ filesys.uuid inst [8 or "/dev/sde7"] value "70180cb3-338f-41bb-8ff0-9cb70d2614cc" mismatches ... -do_uuids: Warning: disk /dev/sda5 not in InDom Cache -do_uuids: Warning: disk /dev/sdb1 not in InDom Cache -do_uuids: Warning: disk /dev/sdb5 not in InDom Cache -do_uuids: Warning: disk /dev/sdb6 not in InDom Cache -do_uuids: Warning: disk /dev/sdb7 not in InDom Cache -do_uuids: Warning: disk /dev/sdd6 not in InDom Cache -do_uuids: Warning: disk /dev/sdd7 not in InDom Cache -do_uuids: Warning: disk /dev/sde1 not in InDom Cache -do_uuids: Warning: disk /dev/vda1 not in InDom Cache -do_uuids: add "/dev/sda1" "4abf1947-f982-4c76-b776-75c996742e7f" -do_uuids: add "/dev/sda6" "eb787c10-e3bf-4b63-9a20-9ca9063a81c2" -do_uuids: add "/dev/sda7" "6bd6fd66-c9a2-418e-8790-7519beeb6fa6" -do_uuids: add "/dev/sdc1" "ca00c9cd-d370-4387-9487-37c15ee82bf4" -do_uuids: add "/dev/sdc5" "d7f9bdc1-40ad-471f-9eb1-846990359f06" -do_uuids: add "/dev/sde5" "7514e1d0-a5ae-42db-9e9f-0015d1ad3035" -do_uuids: add "/dev/sde7" "70180cb3-338f-41bb-8ff0-9cb70d2614cc" +do_uuids: Warning: device /dev/sda5 not in InDom Cache +do_uuids: Warning: device /dev/sdb1 not in InDom Cache +do_uuids: Warning: device /dev/sdb5 not in InDom Cache +do_uuids: Warning: device /dev/sdb6 not in InDom Cache +do_uuids: Warning: device /dev/sdb7 not in InDom Cache +do_uuids: Warning: device /dev/sdd6 not in InDom Cache +do_uuids: Warning: device /dev/sdd7 not in InDom Cache +do_uuids: Warning: device /dev/sde1 not in InDom Cache +do_uuids: Warning: device /dev/vda1 not in InDom Cache +do_uuids: add device "/dev/sda1" uuid "4abf1947-f982-4c76-b776-75c996742e7f" +do_uuids: add device "/dev/sda6" uuid "eb787c10-e3bf-4b63-9a20-9ca9063a81c2" +do_uuids: add device "/dev/sda7" uuid "6bd6fd66-c9a2-418e-8790-7519beeb6fa6" +do_uuids: add device "/dev/sdc1" uuid "ca00c9cd-d370-4387-9487-37c15ee82bf4" +do_uuids: add device "/dev/sdc5" uuid "d7f9bdc1-40ad-471f-9eb1-846990359f06" +do_uuids: add device "/dev/sde5" uuid "7514e1d0-a5ae-42db-9e9f-0015d1ad3035" +do_uuids: add device "/dev/sde7" uuid "70180cb3-338f-41bb-8ff0-9cb70d2614cc" do_uuids: readlink(TMP/root/dev/disk/by-uuid/dead-beef-cafe-feed) failed: Invalid argument -refresh_filesys: add "/" "/dev/sdc1" -refresh_filesys: add "/archive-1" "/dev/sde6" -refresh_filesys: add "/backup" "/dev/vda2" -refresh_filesys: add "/bozo-1" "/dev/sde5" -refresh_filesys: add "/data" "/dev/sda6" -refresh_filesys: add "/ssd-cache" "/dev/sdc5" -refresh_filesys: add "/tmp" "/dev/sda1" -refresh_filesys: add "/vmstore0" "/dev/sda7" -refresh_filesys: add "/vmstore3" "/dev/sde7" +refresh_filesys: add mount "/" device "/dev/sdc1" +refresh_filesys: add mount "/archive-1" device "/dev/sde6" +refresh_filesys: add mount "/backup" device "/dev/vda2" +refresh_filesys: add mount "/bozo-1" device "/dev/sde5" +refresh_filesys: add mount "/data" device "/dev/sda6" +refresh_filesys: add mount "/ssd-cache" device "/dev/sdc5" +refresh_filesys: add mount "/tmp" device "/dev/sda1" +refresh_filesys: add mount "/vmstore0" device "/dev/sda7" +refresh_filesys: add mount "/vmstore3" device "/dev/sde7" filesys.mountdir inst [0 or "/dev/sdc1"] value "/" @@ -110,15 +111,15 @@ filesys.uuid inst [8 or "/dev/sde7"] value "70180cb3-338f-41bb-8ff0-9cb70d2614cc" /dev/disk/by-uuid empty ... -refresh_filesys: add "/" "/dev/sdc1" -refresh_filesys: add "/archive-1" "/dev/sde6" -refresh_filesys: add "/backup" "/dev/vda2" -refresh_filesys: add "/bozo-1" "/dev/sde5" -refresh_filesys: add "/data" "/dev/sda6" -refresh_filesys: add "/ssd-cache" "/dev/sdc5" -refresh_filesys: add "/tmp" "/dev/sda1" -refresh_filesys: add "/vmstore0" "/dev/sda7" -refresh_filesys: add "/vmstore3" "/dev/sde7" +refresh_filesys: add mount "/" device "/dev/sdc1" +refresh_filesys: add mount "/archive-1" device "/dev/sde6" +refresh_filesys: add mount "/backup" device "/dev/vda2" +refresh_filesys: add mount "/bozo-1" device "/dev/sde5" +refresh_filesys: add mount "/data" device "/dev/sda6" +refresh_filesys: add mount "/ssd-cache" device "/dev/sdc5" +refresh_filesys: add mount "/tmp" device "/dev/sda1" +refresh_filesys: add mount "/vmstore0" device "/dev/sda7" +refresh_filesys: add mount "/vmstore3" device "/dev/sde7" filesys.mountdir inst [0 or "/dev/sdc1"] value "/" @@ -145,15 +146,15 @@ filesys.uuid /dev/disk/by-uuid missing ... do_uuids: stat(TMP/root/dev/disk/by-uuid) failed: No such file or directory do_uuids: stat(TMP/root/dev/disk/by-uuid) failed: No such file or directory -refresh_filesys: add "/" "/dev/sdc1" -refresh_filesys: add "/archive-1" "/dev/sde6" -refresh_filesys: add "/backup" "/dev/vda2" -refresh_filesys: add "/bozo-1" "/dev/sde5" -refresh_filesys: add "/data" "/dev/sda6" -refresh_filesys: add "/ssd-cache" "/dev/sdc5" -refresh_filesys: add "/tmp" "/dev/sda1" -refresh_filesys: add "/vmstore0" "/dev/sda7" -refresh_filesys: add "/vmstore3" "/dev/sde7" +refresh_filesys: add mount "/" device "/dev/sdc1" +refresh_filesys: add mount "/archive-1" device "/dev/sde6" +refresh_filesys: add mount "/backup" device "/dev/vda2" +refresh_filesys: add mount "/bozo-1" device "/dev/sde5" +refresh_filesys: add mount "/data" device "/dev/sda6" +refresh_filesys: add mount "/ssd-cache" device "/dev/sdc5" +refresh_filesys: add mount "/tmp" device "/dev/sda1" +refresh_filesys: add mount "/vmstore0" device "/dev/sda7" +refresh_filesys: add mount "/vmstore3" device "/dev/sde7" filesys.mountdir inst [0 or "/dev/sdc1"] value "/" @@ -176,3 +177,64 @@ filesys.uuid inst [6 or "/dev/sda7"] value "" inst [7 or "/dev/sde6"] value "" inst [8 or "/dev/sde7"] value "" + ++++ uuid-01 tarball +++ +situation normal ... + +filesys.mountdir + inst [0 or "/dev/mapper/fedora_vm22-root"] value "/" + inst [1 or "/dev/vda1"] value "/boot" + +filesys.uuid + inst [0 or "/dev/mapper/fedora_vm22-root"] value "d52039cc-5d37-4742-9bd5-0bc80146c9f0" + inst [1 or "/dev/vda1"] value "ab1a4be4-3b08-45c2-8445-b6a577ee1c30" + +/dev/mapper empty ... +do_uuids: Warning: device /dev/dm-0 not in InDom Cache +do_uuids: Warning: device /dev/dm-1 not in InDom Cache +do_uuids: Warning: device /dev/sr0 not in InDom Cache +do_uuids: add device "/dev/vda1" uuid "ab1a4be4-3b08-45c2-8445-b6a577ee1c30" +do_uuids: readlink(TMP/root//dev/mapper/fedora_vm22-root) failed: No such file or directory +refresh_filesys: add mount "/" device "/dev/mapper/fedora_vm22-root" +refresh_filesys: add mount "/boot" device "/dev/vda1" + +filesys.mountdir + inst [0 or "/dev/mapper/fedora_vm22-root"] value "/" + inst [1 or "/dev/vda1"] value "/boot" + +filesys.uuid + inst [0 or "/dev/mapper/fedora_vm22-root"] value "" + inst [1 or "/dev/vda1"] value "ab1a4be4-3b08-45c2-8445-b6a577ee1c30" + +/dev/mapper is bogus ... +do_uuids: Warning: device /dev/dm-0 not in InDom Cache +do_uuids: Warning: device /dev/dm-1 not in InDom Cache +do_uuids: Warning: device /dev/sr0 not in InDom Cache +do_uuids: add device "/dev/vda1" uuid "ab1a4be4-3b08-45c2-8445-b6a577ee1c30" +refresh_filesys: add mount "/" device "/dev/mapper/fedora_vm22-root" dm_device "/dev/dm-13" +refresh_filesys: add mount "/boot" device "/dev/vda1" + +filesys.mountdir + inst [0 or "/dev/mapper/fedora_vm22-root"] value "/" + inst [1 or "/dev/vda1"] value "/boot" + +filesys.uuid + inst [0 or "/dev/mapper/fedora_vm22-root"] value "" + inst [1 or "/dev/vda1"] value "ab1a4be4-3b08-45c2-8445-b6a577ee1c30" + +/dev/mapper missing ... +do_uuids: Warning: device /dev/dm-0 not in InDom Cache +do_uuids: Warning: device /dev/dm-1 not in InDom Cache +do_uuids: Warning: device /dev/sr0 not in InDom Cache +do_uuids: add device "/dev/vda1" uuid "ab1a4be4-3b08-45c2-8445-b6a577ee1c30" +do_uuids: readlink(TMP/root//dev/mapper/fedora_vm22-root) failed: No such file or directory +refresh_filesys: add mount "/" device "/dev/mapper/fedora_vm22-root" +refresh_filesys: add mount "/boot" device "/dev/vda1" + +filesys.mountdir + inst [0 or "/dev/mapper/fedora_vm22-root"] value "/" + inst [1 or "/dev/vda1"] value "/boot" + +filesys.uuid + inst [0 or "/dev/mapper/fedora_vm22-root"] value "" + inst [1 or "/dev/vda1"] value "ab1a4be4-3b08-45c2-8445-b6a577ee1c30" diff --git a/qa/1487.out b/qa/1487.out index 1ff7a4cd5d..71375602a2 100644 --- a/qa/1487.out +++ b/qa/1487.out @@ -1,5 +1,6 @@ QA output created by 1487 QA output created by 1485 --valgrind ++++ uuid-00 tarball +++ situation normal ... === std err === === std out === @@ -80,32 +81,32 @@ ERROR SUMMARY: 0 errors from 0 contexts ... mismatches ... === std err === -do_uuids: Warning: disk /dev/sda5 not in InDom Cache -do_uuids: Warning: disk /dev/sdb1 not in InDom Cache -do_uuids: Warning: disk /dev/sdb5 not in InDom Cache -do_uuids: Warning: disk /dev/sdb6 not in InDom Cache -do_uuids: Warning: disk /dev/sdb7 not in InDom Cache -do_uuids: Warning: disk /dev/sdd6 not in InDom Cache -do_uuids: Warning: disk /dev/sdd7 not in InDom Cache -do_uuids: Warning: disk /dev/sde1 not in InDom Cache -do_uuids: Warning: disk /dev/vda1 not in InDom Cache -do_uuids: add "/dev/sda1" "4abf1947-f982-4c76-b776-75c996742e7f" -do_uuids: add "/dev/sda6" "eb787c10-e3bf-4b63-9a20-9ca9063a81c2" -do_uuids: add "/dev/sda7" "6bd6fd66-c9a2-418e-8790-7519beeb6fa6" -do_uuids: add "/dev/sdc1" "ca00c9cd-d370-4387-9487-37c15ee82bf4" -do_uuids: add "/dev/sdc5" "d7f9bdc1-40ad-471f-9eb1-846990359f06" -do_uuids: add "/dev/sde5" "7514e1d0-a5ae-42db-9e9f-0015d1ad3035" -do_uuids: add "/dev/sde7" "70180cb3-338f-41bb-8ff0-9cb70d2614cc" +do_uuids: Warning: device /dev/sda5 not in InDom Cache +do_uuids: Warning: device /dev/sdb1 not in InDom Cache +do_uuids: Warning: device /dev/sdb5 not in InDom Cache +do_uuids: Warning: device /dev/sdb6 not in InDom Cache +do_uuids: Warning: device /dev/sdb7 not in InDom Cache +do_uuids: Warning: device /dev/sdd6 not in InDom Cache +do_uuids: Warning: device /dev/sdd7 not in InDom Cache +do_uuids: Warning: device /dev/sde1 not in InDom Cache +do_uuids: Warning: device /dev/vda1 not in InDom Cache +do_uuids: add device "/dev/sda1" uuid "4abf1947-f982-4c76-b776-75c996742e7f" +do_uuids: add device "/dev/sda6" uuid "eb787c10-e3bf-4b63-9a20-9ca9063a81c2" +do_uuids: add device "/dev/sda7" uuid "6bd6fd66-c9a2-418e-8790-7519beeb6fa6" +do_uuids: add device "/dev/sdc1" uuid "ca00c9cd-d370-4387-9487-37c15ee82bf4" +do_uuids: add device "/dev/sdc5" uuid "d7f9bdc1-40ad-471f-9eb1-846990359f06" +do_uuids: add device "/dev/sde5" uuid "7514e1d0-a5ae-42db-9e9f-0015d1ad3035" +do_uuids: add device "/dev/sde7" uuid "70180cb3-338f-41bb-8ff0-9cb70d2614cc" do_uuids: readlink(TMP/root/dev/disk/by-uuid/dead-beef-cafe-feed) failed: Invalid argument -refresh_filesys: add "/" "/dev/sdc1" -refresh_filesys: add "/archive-1" "/dev/sde6" -refresh_filesys: add "/backup" "/dev/vda2" -refresh_filesys: add "/bozo-1" "/dev/sde5" -refresh_filesys: add "/data" "/dev/sda6" -refresh_filesys: add "/ssd-cache" "/dev/sdc5" -refresh_filesys: add "/tmp" "/dev/sda1" -refresh_filesys: add "/vmstore0" "/dev/sda7" -refresh_filesys: add "/vmstore3" "/dev/sde7" +refresh_filesys: add mount "/" device "/dev/sdc1" +refresh_filesys: add mount "/archive-1" device "/dev/sde6" +refresh_filesys: add mount "/backup" device "/dev/vda2" +refresh_filesys: add mount "/bozo-1" device "/dev/sde5" +refresh_filesys: add mount "/data" device "/dev/sda6" +refresh_filesys: add mount "/ssd-cache" device "/dev/sdc5" +refresh_filesys: add mount "/tmp" device "/dev/sda1" +refresh_filesys: add mount "/vmstore0" device "/dev/sda7" +refresh_filesys: add mount "/vmstore3" device "/dev/sde7" === std out === filesys.mountdir @@ -139,15 +140,15 @@ ERROR SUMMARY: 0 errors from 0 contexts ... /dev/disk/by-uuid empty ... === std err === -refresh_filesys: add "/" "/dev/sdc1" -refresh_filesys: add "/archive-1" "/dev/sde6" -refresh_filesys: add "/backup" "/dev/vda2" -refresh_filesys: add "/bozo-1" "/dev/sde5" -refresh_filesys: add "/data" "/dev/sda6" -refresh_filesys: add "/ssd-cache" "/dev/sdc5" -refresh_filesys: add "/tmp" "/dev/sda1" -refresh_filesys: add "/vmstore0" "/dev/sda7" -refresh_filesys: add "/vmstore3" "/dev/sde7" +refresh_filesys: add mount "/" device "/dev/sdc1" +refresh_filesys: add mount "/archive-1" device "/dev/sde6" +refresh_filesys: add mount "/backup" device "/dev/vda2" +refresh_filesys: add mount "/bozo-1" device "/dev/sde5" +refresh_filesys: add mount "/data" device "/dev/sda6" +refresh_filesys: add mount "/ssd-cache" device "/dev/sdc5" +refresh_filesys: add mount "/tmp" device "/dev/sda1" +refresh_filesys: add mount "/vmstore0" device "/dev/sda7" +refresh_filesys: add mount "/vmstore3" device "/dev/sde7" === std out === filesys.mountdir @@ -183,15 +184,15 @@ ERROR SUMMARY: 0 errors from 0 contexts ... === std err === do_uuids: stat(TMP/root/dev/disk/by-uuid) failed: No such file or directory do_uuids: stat(TMP/root/dev/disk/by-uuid) failed: No such file or directory -refresh_filesys: add "/" "/dev/sdc1" -refresh_filesys: add "/archive-1" "/dev/sde6" -refresh_filesys: add "/backup" "/dev/vda2" -refresh_filesys: add "/bozo-1" "/dev/sde5" -refresh_filesys: add "/data" "/dev/sda6" -refresh_filesys: add "/ssd-cache" "/dev/sdc5" -refresh_filesys: add "/tmp" "/dev/sda1" -refresh_filesys: add "/vmstore0" "/dev/sda7" -refresh_filesys: add "/vmstore3" "/dev/sde7" +refresh_filesys: add mount "/" device "/dev/sdc1" +refresh_filesys: add mount "/archive-1" device "/dev/sde6" +refresh_filesys: add mount "/backup" device "/dev/vda2" +refresh_filesys: add mount "/bozo-1" device "/dev/sde5" +refresh_filesys: add mount "/data" device "/dev/sda6" +refresh_filesys: add mount "/ssd-cache" device "/dev/sdc5" +refresh_filesys: add mount "/tmp" device "/dev/sda1" +refresh_filesys: add mount "/vmstore0" device "/dev/sda7" +refresh_filesys: add mount "/vmstore3" device "/dev/sde7" === std out === filesys.mountdir @@ -222,3 +223,100 @@ LEAK SUMMARY: definitely lost: 0 bytes in 0 blocks indirectly lost: 0 bytes in 0 blocks ERROR SUMMARY: 0 errors from 0 contexts ... + ++++ uuid-01 tarball +++ +situation normal ... +=== std err === +=== std out === + +filesys.mountdir + inst [0 or "/dev/mapper/fedora_vm22-root"] value "/" + inst [1 or "/dev/vda1"] value "/boot" + +filesys.uuid + inst [0 or "/dev/mapper/fedora_vm22-root"] value "d52039cc-5d37-4742-9bd5-0bc80146c9f0" + inst [1 or "/dev/vda1"] value "ab1a4be4-3b08-45c2-8445-b6a577ee1c30" +=== filtered valgrind report === +Memcheck, a memory error detector +Command: pminfo -L -f filesys.mountdir filesys.uuid +LEAK SUMMARY: +definitely lost: 0 bytes in 0 blocks +indirectly lost: 0 bytes in 0 blocks +ERROR SUMMARY: 0 errors from 0 contexts ... + +/dev/mapper empty ... +=== std err === +do_uuids: Warning: device /dev/dm-0 not in InDom Cache +do_uuids: Warning: device /dev/dm-1 not in InDom Cache +do_uuids: Warning: device /dev/sr0 not in InDom Cache +do_uuids: add device "/dev/vda1" uuid "ab1a4be4-3b08-45c2-8445-b6a577ee1c30" +do_uuids: readlink(TMP/root//dev/mapper/fedora_vm22-root) failed: No such file or directory +refresh_filesys: add mount "/" device "/dev/mapper/fedora_vm22-root" +refresh_filesys: add mount "/boot" device "/dev/vda1" +=== std out === + +filesys.mountdir + inst [0 or "/dev/mapper/fedora_vm22-root"] value "/" + inst [1 or "/dev/vda1"] value "/boot" + +filesys.uuid + inst [0 or "/dev/mapper/fedora_vm22-root"] value "" + inst [1 or "/dev/vda1"] value "ab1a4be4-3b08-45c2-8445-b6a577ee1c30" +=== filtered valgrind report === +Memcheck, a memory error detector +Command: pminfo -L -Dappl8 -f filesys.mountdir filesys.uuid +LEAK SUMMARY: +definitely lost: 0 bytes in 0 blocks +indirectly lost: 0 bytes in 0 blocks +ERROR SUMMARY: 0 errors from 0 contexts ... + +/dev/mapper is bogus ... +=== std err === +do_uuids: Warning: device /dev/dm-0 not in InDom Cache +do_uuids: Warning: device /dev/dm-1 not in InDom Cache +do_uuids: Warning: device /dev/sr0 not in InDom Cache +do_uuids: add device "/dev/vda1" uuid "ab1a4be4-3b08-45c2-8445-b6a577ee1c30" +refresh_filesys: add mount "/" device "/dev/mapper/fedora_vm22-root" dm_device "/dev/dm-13" +refresh_filesys: add mount "/boot" device "/dev/vda1" +=== std out === + +filesys.mountdir + inst [0 or "/dev/mapper/fedora_vm22-root"] value "/" + inst [1 or "/dev/vda1"] value "/boot" + +filesys.uuid + inst [0 or "/dev/mapper/fedora_vm22-root"] value "" + inst [1 or "/dev/vda1"] value "ab1a4be4-3b08-45c2-8445-b6a577ee1c30" +=== filtered valgrind report === +Memcheck, a memory error detector +Command: pminfo -L -Dappl8 -f filesys.mountdir filesys.uuid +LEAK SUMMARY: +definitely lost: 0 bytes in 0 blocks +indirectly lost: 0 bytes in 0 blocks +ERROR SUMMARY: 0 errors from 0 contexts ... + +/dev/mapper missing ... +=== std err === +do_uuids: Warning: device /dev/dm-0 not in InDom Cache +do_uuids: Warning: device /dev/dm-1 not in InDom Cache +do_uuids: Warning: device /dev/sr0 not in InDom Cache +do_uuids: add device "/dev/vda1" uuid "ab1a4be4-3b08-45c2-8445-b6a577ee1c30" +do_uuids: readlink(TMP/root//dev/mapper/fedora_vm22-root) failed: No such file or directory +refresh_filesys: add mount "/" device "/dev/mapper/fedora_vm22-root" +refresh_filesys: add mount "/boot" device "/dev/vda1" +=== std out === + +filesys.mountdir + inst [0 or "/dev/mapper/fedora_vm22-root"] value "/" + inst [1 or "/dev/vda1"] value "/boot" + +filesys.uuid + inst [0 or "/dev/mapper/fedora_vm22-root"] value "" + inst [1 or "/dev/vda1"] value "ab1a4be4-3b08-45c2-8445-b6a577ee1c30" +=== filtered valgrind report === +Memcheck, a memory error detector +Command: pminfo -L -Dappl8 -f filesys.mountdir filesys.uuid +LEAK SUMMARY: +definitely lost: 0 bytes in 0 blocks +indirectly lost: 0 bytes in 0 blocks +ERROR SUMMARY: 0 errors from 0 contexts ... diff --git a/qa/linux/mk.uuid b/qa/linux/mk.uuid index 8c113ee013..ec376ccaea 100755 --- a/qa/linux/mk.uuid +++ b/qa/linux/mk.uuid @@ -2,24 +2,30 @@ # # rebuild the uuid-root tarball -here=`pwd` +# regular files, paths relative to / +# filelist="proc/self/mounts" -dirlist="dev/disk/by-uuid" -rm -rf tmp + +# directories, paths relative to / +# +dirlist="dev/disk/by-uuid dev/mapper" + +here=`pwd` +sudo rm -rf tmp mkdir tmp || exit 1 cd tmp || exit 1 for dir in $dirlist do [ -d "./$dir" ] || mkdir -p "./$dir" || exit 1 - cp -r /$dir/* ./$dir || exit 1 + (( cd /; tar cf - $dir ) | sudo tar xpf - ) || exit 1 done for file in $filelist do dir=`dirname $file` [ -d "./$dir" ] || mkdir -p "./$dir" || exit 1 - cp /$file ./$dir + sudo cp "/$file" "./$file" || exit 1 done cd ./dev/disk/by-uuid || exit 1 @@ -28,6 +34,7 @@ devs="`ls -l | sed -n '/ -> /s@.*/@@p'`" cd $here/tmp tar czf ../uuid-root.tgz proc dev - cd $here -rm -rf tmp + +echo "uuid-root.tgz created, remember to rename uid-NN-root.tgz before commit" +echo "FYI, unpacked .tgz remains in ./tmp for LINUX_STATSPATH=tmp ... use" diff --git a/qa/linux/uuid-root.tgz b/qa/linux/uuid-00-root.tgz similarity index 100% rename from qa/linux/uuid-root.tgz rename to qa/linux/uuid-00-root.tgz diff --git a/qa/linux/uuid-01-root.tgz b/qa/linux/uuid-01-root.tgz new file mode 100644 index 0000000000000000000000000000000000000000..b98d421835fa1c86acd8e5e2576c17d8cc608c51 GIT binary patch literal 1251 zcmV<91RVPxiwFP!000001MOPrmZK;b&F^^%A3$3`MDrt$Fwc?w4n&b7!Q0OhhBh# zBmPm~$@LHB=*%$&{#jj%OV3>^e^ayoqeUe0lG>3F4B2^Ar<7p3s5fz&@l~i}JpY%jJoI5#^{=)Tkp(R9muyFrjWnlP zw8qrbcvbT@Pi(M%(M7=OC%8EZ-c>VV7x*Ww*?qa*~#-zxCHGb$U^< zwz?+BZn+Q?pm3`A5H1k_rxh<9c3!o+VQ6xK`W$OtGVSCEg?({B%hZA0xW;+TtE?33 zGUtgEwW99qjMJN?D-YYvhBYf_tDL$OE7`}qQvBCyMMS$Hn&wg+!fx`0sxhswkGtNN zzgpVTZq@biKDbLCKidrzMLaBhm29F7<<`F7ti5qWx`rYE{oT>VqJ$nvM&;$z#v01* z>Sapf_E>{D&l*bZGMBaTSy7CZ#g#Ivw-6mU*vn4nPYdPuRCsp(S7gn7 z#(3cV=K*BS|F3}JKh62aoFaJO{)aql_#((M~;4PEH@l!8waDb7sj8oqMaS{TENwUoDy_akLgWxv)q0|Wi7|8oS z`tie+pR{yld=p^!Kjc3S$r8k2=ABme3yG0WIB4F8Ax zBRTsHlpo{(;sDTn|5h7!^ADxc_UoUsIbQ@D{)gAUv$b*8`A_+O2#M#J^WQ5l;XkP> z!Rq4qZ771tciu0oe~bgkzxVvEe8;o+*TaBFhn~E>ya_J+{PVOn?mquP-}n5^|Id5) zUzqiOnt%QoHBW2f5&qGh{}~T|3&X$q(R9`WR`37G5%18u^!`VAQ0pa5^j7|pl-1>h z@}ogLxtFtH__1crHcs*n$VL7!`NQ~Em!wPOdfyL*e{z}EXFU=6{x`FaeSm-DqqpSW ze^dTv^;Zw^58j&pxAFf51_lNO1_lNO1_lNO1_lNO1_lNO1_lNO1_lNO1_lNO1_tko N{{VpetvCQs004)8h4BCY literal 0 HcmV?d00001 diff --git a/src/pmdas/linux/filesys.c b/src/pmdas/linux/filesys.c index 583b704daf..0d91287007 100644 --- a/src/pmdas/linux/filesys.c +++ b/src/pmdas/linux/filesys.c @@ -136,11 +136,8 @@ do_uuids(pmInDom filesys_indom) /* match dm_device for a different device */ break; } - if (fs == NULL) { - if (pmDebugOptions.appl8) - fprintf(stderr, "do_uuids: Warning: dm_device %s not in InDom Cache\n", device); + if (fs == NULL) continue; - } } if (fs->uuid == NULL) { /*