Actions
Bug #15307
closedzpool status -v list wrong devicename after 15232
Start date:
Due date:
% Done:
100%
Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:
External Bug:
Description
After the integration of the fix for 15232 zpool status -v now shows the wrong device names when they start with /dev/dsk/
After some talk with Andy the author of the patch we came to the following conclusion e.g. the memmove done is
copying 2 bytes short of what it actually needs to copy. A dirty test program showed the problem and the fix.
#include <limits.h>
#include <stdio.h>
#include <string.h>
#define ZFS_DISK_ROOTD "/dev/rdsk/"
int main(int argc, char **argv)
{
char path[PATH_MAX];
strcpy(path, "/dev/rdsk/c0t0d0s0");
if (strncmp(path, ZFS_DISK_ROOTD, sizeof (ZFS_DISK_ROOTD) - 1) == 0) {
memmove(path, path + sizeof (ZFS_DISK_ROOTD) - 1, strlen(path) - sizeof (ZFS_DISK_ROOTD) + 2);
}
fprintf(stdout, "%s\n", path);
}
Related issues
Updated by Marco van Wieringen 5 months ago
- Related to Bug #15232: zpool list truncates device names added
Updated by Marco van Wieringen 5 months ago
- Status changed from New to In Progress
Updated by Andy Fiddaman 5 months ago
I built and tested this change to verify that the regression from #15232 is resolved.
build:change-2589:change-2589% LD_LIBRARY_PATH=$ROOT/lib/64:$ROOT/usr/lib/64 zpool status data pool: data state: ONLINE scan: scrub repaired 0 in 0 days 05:21:10 with 0 errors on Sat Jan 7 07:51:11 2023 config: NAME STATE READ WRITE CKSUM data ONLINE 0 0 0 raidz2-0 ONLINE 0 0 0 c0t2d1 ONLINE 0 0 0 c0t3d1 ONLINE 0 0 0 c0t4d1 ONLINE 0 0 0 c0t5d1 ONLINE 0 0 0 c0t6d1 ONLINE 0 0 0 c0t7d1 ONLINE 0 0 0 logs c0t14d1 ONLINE 0 0 0 cache c0t15d1 ONLINE 0 0 0 c1t5002361000372431d0 ONLINE 0 0 0 c1t5002361000376094d0 ONLINE 0 0 0 c1t5002361000379534d0 ONLINE 0 0 0 c1t5002361000338013d0 ONLINE 0 0 0 spares c0t8d1 AVAIL
Updated by Andy Fiddaman 5 months ago
I've re-tested the updated fix from Gerrit and confirmed that it still works.
Updated by Electric Monk 5 months ago
- Status changed from In Progress to Closed
git commit 587f87a428ddaa788439aa952a1832a3538e092d
commit 587f87a428ddaa788439aa952a1832a3538e092d Author: Marco van Wieringen <marco.van.wieringen@planets.elm.net> Date: 2023-01-08T20:42:38.000Z 15307 zpool status -v list wrong devicename after 15232 Reviewed by: Andy Fiddaman <illumos@fiddaman.net> Reviewed by: Toomas Soome <tsoome@me.com> Approved by: Gordon Ross <Gordon.W.Ross@gmail.com>
Actions