summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorLOLi <[email protected]>2017-12-19 19:49:33 +0100
committerBrian Behlendorf <[email protected]>2017-12-19 10:49:33 -0800
commitc30e34faa12e4b6e190edcccd4b2db185a286680 (patch)
treea52c946aab279cca8486309c4ff4a896fbf90f07 /cmd
parentbbffb59efc49baba1d131d497202e8cda0068c3d (diff)
ZTS: Fix create-o_ashift test case
The function that fills the uberblock ring buffer on every device label has been reworked to avoid occasional failures caused by a race condition that prevents 'zpool sync' from writing some uberblock sequentially: this happens when the pool sync ioctl dispatch code calls txg_wait_synced() while we're already waiting for a TXG to sync. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: loli10K <[email protected]> Closes #6924 Closes #6977
Diffstat (limited to 'cmd')
-rw-r--r--cmd/zdb/zdb.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c
index cc4f22a9e..69001071d 100644
--- a/cmd/zdb/zdb.c
+++ b/cmd/zdb/zdb.c
@@ -2788,10 +2788,6 @@ dump_label(const char *dev)
exit(1);
}
- if (ioctl(fd, BLKFLSBUF) != 0)
- (void) printf("failed to invalidate cache '%s' : %s\n", path,
- strerror(errno));
-
if (fstat64_blk(fd, &statbuf) != 0) {
(void) printf("failed to stat '%s': %s\n", path,
strerror(errno));
@@ -2799,6 +2795,10 @@ dump_label(const char *dev)
exit(1);
}
+ if (S_ISBLK(statbuf.st_mode) && ioctl(fd, BLKFLSBUF) != 0)
+ (void) printf("failed to invalidate cache '%s' : %s\n", path,
+ strerror(errno));
+
avl_create(&config_tree, cksum_record_compare,
sizeof (cksum_record_t), offsetof(cksum_record_t, link));
avl_create(&uberblock_tree, cksum_record_compare,