[zfs-devel] zfs send problem with growing holes at end of zvol

Boris bprotopopov at hotmail.com
Wed Jul 29 11:47:11 EDT 2015


For those who might be interested, I found the fix - zfsonlinux commit a4069eePorted from illumos/illumos-gate at 70163ac

Best regards.

From: bprotopopov at hotmail.com
To: zfs-devel at list.zfsonlinux.org; zfs at lists.illumos.org
Subject: zfs send problem with growing holes at end of zvol
Date: Tue, 28 Jul 2015 16:47:16 -0400




Hi, guys, 
I have recently ran info the following issue with zfs send on Linux. I have a sparse zvol with a block range close to the end of the zvol filled with random data, after which there is a hole all the way to the end. The zvol is compressed (lz4), and the hole_birth feature is active on the pool, so writing zero blocks in the zvol results in punching holes. 
If I snap the zvol (zvol at s1), then overwrite the end of the zvol's last data byte range with zeros (effectively extending the existing hole toward the beginning of the zvol), then snap again (zvol at s2) and then zfs send -i zvol at s1 zvol at s2, zfs send fails to detect this new hole. Here is an example (below).
I am creating a zvol of 6.4G and wiring 10 blocks [80-90) of random data to it. Then snap, zdb to show 10 blocks on disk. Then I am overwriting the last 5 blocks of that range with zeros. Then snap, zdb to show the last 5 blocks went away (freed). Then I run incremental send and parse the stream - see the only FREE (truncate) record for object 1 (the data object) starting at block 90, as opposed to block 85. Seems like a problem. 
I also tried receiving zfs send stream on top of zvol at s1 and comparing the resulting snapshot with the original one copied out to a file - their contents do differ. 
Does anyone see the same ? Perhaps I missed a commit that fixes this ? 
Best regards,Boris Protopopov. 








[root at testbox ~]# zfs create -V6400K -s -b 64k testpool/zvol1[root at testbox ~]# dd if=/dev/urandom of=/dev/zvol/testpool/zvol1 bs=64k count=10 seek=80 oflag=direct,sync10+0 records in10+0 records out655360 bytes (655 kB) copied, 0.189747 s, 3.5 MB/s[root at testbox ~]# zfs snapshot testpool/zvol1 at s1[root at testbox ~]# zdb -ddddddd  testpool/zvol1 at s1 1Dataset testpool/zvol1 at s1 [ZVOL], ID 7280, cr_txg 416286, 712K, 2 objects, rootbp DVA[0]=<0:45b3d8b000:1000> DVA[1]=<0:8ced53\c000:1000> [L0 DMU objset] fletcher4 lzjb LE contiguous unique double size=800L/200P birth=416275L/416275P fill=2 cksum=f279b\5326:5b91f729676:11e08ca7904a3:26744dff3e9ca0
    Object  lvl   iblk   dblk  dsize  lsize   %full  type         1    2    16K    64K   648K  5.62M   11.11  zvol object (K=inherit) (Z=inherit)         dnode flags: USED_BYTES         dnode maxblkid: 89Indirect blocks:               0 L1  0:45b3d83000:1000 0:8ced534000:1000 4000L/400P F=10 B=416275/416275          500000  L0 0:2803ae0000:10000 10000L/10000P F=1 B=416274/416274          510000  L0 0:4418daf000:10000 10000L/10000P F=1 B=416275/416275          520000  L0 0:4418dbf000:10000 10000L/10000P F=1 B=416275/416275          530000  L0 0:4418dcf000:10000 10000L/10000P F=1 B=416275/416275          540000  L0 0:4418ddf000:10000 10000L/10000P F=1 B=416275/416275          550000  L0 0:4418def000:10000 10000L/10000P F=1 B=416275/416275          560000  L0 0:4418dff000:10000 10000L/10000P F=1 B=416275/416275          570000  L0 0:4418e0f000:10000 10000L/10000P F=1 B=416275/416275          580000  L0 0:4418e1f000:10000 10000L/10000P F=1 B=416275/416275          590000  L0 0:4418e2f000:10000 10000L/10000P F=1 B=416275/416275
                  segment [0000000000500000, 00000000005a0000) size  640K
[root at testbox ~]# dd if=/dev/zero of=/dev/zvol/testpool/zvol1 bs=64k count=5 seek=85 oflag=direct,sync5+0 records in5+0 records out327680 bytes (328 kB) copied, 0.248917 s, 1.3 MB/s[root at testbox ~]# zfs snapshot testpool/zvol1 at s2[root at testbox ~]# zdb -ddddddd  testpool/zvol1 at s2 1Dataset testpool/zvol1 at s2 [ZVOL], ID 7283, cr_txg 416299, 392K, 2 objects, rootbp DVA[0]=<0:299c0e1000:1000> DVA[1]=<0:8ced90\6000:1000> [L0 DMU objset] fletcher4 lzjb LE contiguous unique double size=800L/200P birth=416298L/416298P fill=2 cksum=10e59\9ba28:66237fe210e:13df198761d77:2a6e3e3ec8d66b
    Object  lvl   iblk   dblk  dsize  lsize   %full  type         1    2    16K    64K   328K  5.62M    5.56  zvol object (K=inherit) (Z=inherit)         dnode flags: USED_BYTES


















































         dnode maxblkid: 89Indirect blocks:               0 L1  0:299c0d9000:1000 0:8ced8fe000:1000 4000L/400P F=5 B=416298/416298          500000  L0 0:2803ae0000:10000 10000L/10000P F=1 B=416274/416274          510000  L0 0:4418daf000:10000 10000L/10000P F=1 B=416275/416275          520000  L0 0:4418dbf000:10000 10000L/10000P F=1 B=416275/416275          530000  L0 0:4418dcf000:10000 10000L/10000P F=1 B=416275/416275          540000  L0 0:4418ddf000:10000 10000L/10000P F=1 B=416275/416275
                  segment [0000000000500000, 0000000000550000) size  320K
[root at testbox ~]# zfs send -i testpool/zvol1 at s1 testpool/zvol1 at s2 | zstreamdump -vBEGIN record      hdrtype = 1      features = 0      magic = 2f5bacbac      creation_time = 55b7e1ba      type = 3      flags = 0x0      toguid = d36737f7251a667a      fromguid = b8c7dee4ab6e349      toname = testpool/zvol1 at s2
FREEOBJECTS firstobj = 0 numobjs = 1OBJECT object = 1 type = 23 bonustype = 0 blksz = 65536 bonuslen = 0FREE object = 1 offset = 5898240 length = -1OBJECT object = 2 type = 24 bonustype = 0 blksz = 512 bonuslen = 0FREE object = 2 offset = 512 length = -1FREEOBJECTS firstobj = 3 numobjs = 29END checksum = e67058736/132126d091f6/faeea90ec738b/989a6d134d609e7SUMMARY:        Total DRR_BEGIN records = 1        Total DRR_END records = 1        Total DRR_OBJECT records = 2        Total DRR_FREEOBJECTS records = 2        Total DRR_WRITE records = 0        Total DRR_WRITE_BYREF records = 0        Total DRR_WRITE_EMBEDDED records = 0        Total DRR_FREE records = 2        Total DRR_SPILL records = 0        Total records = 8        Total write size = 0 (0x0)        Total stream length = 2496 (0x9c0)[root at testbox ~]# echo $((5898240/(64*1024)))90[root at testbox ~]# echo $((5898240%(64*1024)))0





















































[root at testbox ~]# 		 	   		   		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.zfsonlinux.org/pipermail/zfs-devel/attachments/20150729/f69d88e4/attachment-0001.html>


More information about the zfs-devel mailing list