diff options
author | Ricardo M. Correia <[email protected]> | 2010-12-14 09:50:37 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2010-12-14 09:52:46 -0800 |
commit | 8d4e8140ef67fa9c8fa0b1d0f5b1d5d36c747969 (patch) | |
tree | ced2415e5af0232e7847a6c607b21e8e3196e8cf /cmd | |
parent | a7dc7e5d5a5c4a68266b3d9ce89c6c53c04b1741 (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')
-rw-r--r-- | cmd/zdb/zdb.c | 10 |
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)); |