summaryrefslogtreecommitdiffstats
path: root/cmd/zdb/zdb.c
diff options
context:
space:
mode:
authorRicardo M. Correia <[email protected]>2010-12-14 09:50:37 -0800
committerBrian Behlendorf <[email protected]>2010-12-14 09:52:46 -0800
commit8d4e8140ef67fa9c8fa0b1d0f5b1d5d36c747969 (patch)
treeced2415e5af0232e7847a6c607b21e8e3196e8cf /cmd/zdb/zdb.c
parenta7dc7e5d5a5c4a68266b3d9ce89c6c53c04b1741 (diff)
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 <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'cmd/zdb/zdb.c')
-rw-r--r--cmd/zdb/zdb.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c
index a5ad7feb8..2f5f19e22 100644
--- a/cmd/zdb/zdb.c
+++ b/cmd/zdb/zdb.c
@@ -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));