mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
Fix block device-related issues in zdb.
Specifically, this fixes the two following errors in zdb when a pool is composed of block devices: 1) 'Value too large for defined data type' when running 'zdb <dataset>'. 2) 'character device required' when running 'zdb -l <block-device>'. Signed-off-by: Ricardo M. Correia <ricardo.correia@oracle.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
committed by
Brian Behlendorf
parent
a7dc7e5d5a
commit
8d4e8140ef
+1
-9
@@ -1803,7 +1803,7 @@ dump_label(const char *dev)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (fstat64(fd, &statbuf) != 0) {
|
||||
if (fstat64_blk(fd, &statbuf) != 0) {
|
||||
(void) printf("failed to stat '%s': %s\n", path,
|
||||
strerror(errno));
|
||||
free(path);
|
||||
@@ -1811,14 +1811,6 @@ dump_label(const char *dev)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (S_ISBLK(statbuf.st_mode)) {
|
||||
(void) printf("cannot use '%s': character device required\n",
|
||||
path);
|
||||
free(path);
|
||||
(void) close(fd);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
psize = statbuf.st_size;
|
||||
psize = P2ALIGN(psize, (uint64_t)sizeof (vdev_label_t));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user