Author: avg
Date: Wed Jul 20 09:54:18 2016
New Revision: 303081
URL: https://svnweb.freebsd.org/changeset/base/303081

Log:
  7163 ztest failures due to excess error injection
  
  illumos/illumos-gate@f34284d835bc555f987c1310df46c034c3101155
  
https://github.com/illumos/illumos-gate/commit/f34284d835bc555f987c1310df46c034c3101155
  
  https://www.illumos.org/issues/7163
    Running zloop from zfs-precommit hit this assertion:
         *panicstr/s
    0xfffffd7fd7419370: assertion failed for thread 0xfffffd7fe29ed240,
    thread-id 577: parent != NULL, file ../../../uts/common/fs/zfs/dbuf.c, line
    1827
         $c
    libc.so.1`_lwp_kill+0xa()
    libc.so.1`_assfail+0x182(fffffd7ffb1c29fa, fffffd7ffb1cc028, 723)
    libc.so.1`assfail+0x19(fffffd7ffb1c29fa, fffffd7ffb1cc028, 723)
    libzpool.so.1`dbuf_dirty+0xc69(10e3bc10, 3601700)
    libzpool.so.1`dbuf_dirty+0x61e(10c73640, 3601700)
    libzpool.so.1`dbuf_dirty+0x61e(10e28280, 3601700)
    libzpool.so.1`dmu_buf_will_fill+0x64(10e28280, 3601700)
    libzpool.so.1`dmu_write+0x1b6(2c7e640, d, 400000002e000000, 200, 3717b40,
    3601700)
    ztest_replay_write+0x568(4950d0, 3717a80, 0)
    ztest_write+0x125(4950d0, d, 400000002e000000, 200, 413f000)
    ztest_io+0x1bb(4950d0, d, 400000002e000000)
    ztest_dmu_write_parallel+0xaa(4950d0, 6)
    ztest_execute+0x83(1, 420c98, 6)
    ztest_thread+0xf4(6)
    libc.so.1`_thrp_setup+0x8a(fffffd7fe29ed240)
    libc.so.1`_lwp_start()
    This is another manifestation of ECKSUM in ztest:
    The lowest level ancestor that’s in memory is the L8 (topmost). The L7
    ancestor is blkid 0x10:
         ::dbufs -O 0x2c7e640 -o d -l 7 |::dbuf
    addr object lvl blkid holds os
    600be50 d 7 4 1 ztest/ds_6
    719d880 d 7 0 4 ztest/ds_6
  
  Reviewed by: George Wilson <george.wil...@delphix.com>
  Reviewed by: Paul Dagnelie <p...@delphix.com>
  Approved by: Robert Mustacchi <r...@joyent.com>
  Author: Matthew Ahrens <mahr...@delphix.com>

Modified:
  vendor/illumos/dist/cmd/ztest/ztest.c

Modified: vendor/illumos/dist/cmd/ztest/ztest.c
==============================================================================
--- vendor/illumos/dist/cmd/ztest/ztest.c       Wed Jul 20 09:53:46 2016        
(r303080)
+++ vendor/illumos/dist/cmd/ztest/ztest.c       Wed Jul 20 09:54:18 2016        
(r303081)
@@ -4792,7 +4792,7 @@ ztest_fault_inject(ztest_ds_t *zd, uint6
        char path0[MAXPATHLEN];
        char pathrand[MAXPATHLEN];
        size_t fsize;
-       int bshift = SPA_MAXBLOCKSHIFT + 2;     /* don't scrog all labels */
+       int bshift = SPA_MAXBLOCKSHIFT + 2;
        int iters = 1000;
        int maxfaults;
        int mirror_save;
@@ -4982,7 +4982,29 @@ ztest_fault_inject(ztest_ds_t *zd, uint6
                    (leaves << bshift) + (leaf << bshift) +
                    (ztest_random(1ULL << (bshift - 1)) & -8ULL);
 
-               if (offset >= fsize)
+               /*
+                * Only allow damage to the labels at one end of the vdev.
+                *
+                * If all labels are damaged, the device will be totally
+                * inaccessible, which will result in loss of data,
+                * because we also damage (parts of) the other side of
+                * the mirror/raidz.
+                *
+                * Additionally, we will always have both an even and an
+                * odd label, so that we can handle crashes in the
+                * middle of vdev_config_sync().
+                */
+               if ((leaf & 1) == 0 && offset < VDEV_LABEL_START_SIZE)
+                       continue;
+
+               /*
+                * The two end labels are stored at the "end" of the disk, but
+                * the end of the disk (vdev_psize) is aligned to
+                * sizeof (vdev_label_t).
+                */
+               uint64_t psize = P2ALIGN(fsize, sizeof (vdev_label_t));
+               if ((leaf & 1) == 1 &&
+                   offset + sizeof (bad) > psize - VDEV_LABEL_END_SIZE)
                        continue;
 
                VERIFY(mutex_lock(&ztest_vdev_lock) == 0);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to