From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1YqI13-0005Lr-NP for mharc-grub-devel@gnu.org; Thu, 07 May 2015 05:22:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52329) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqI11-0005Ku-38 for grub-devel@gnu.org; Thu, 07 May 2015 05:22:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YqI0y-0004vs-Ps for grub-devel@gnu.org; Thu, 07 May 2015 05:22:47 -0400 Received: from mail-wg0-x22c.google.com ([2a00:1450:400c:c00::22c]:35547) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqI0y-0004uO-Gs for grub-devel@gnu.org; Thu, 07 May 2015 05:22:44 -0400 Received: by wgyo15 with SMTP id o15so37211809wgy.2 for ; Thu, 07 May 2015 02:22:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=p1xeQBLmN5UtYWyjZqeb9jjSznU3nelGJjobXJFnLPA=; b=lIE4uR9aBLJtZSWscRuXG5UaH+EZQnKDpNoIa3ArGJy7B/LrhxKYI5WmBrcnIjvXdX /vIjxqY21XrHbILmm0XsmO3/LEUGGfj6S6WLRa0BAMwbCapqNzPdFgxyrE3x3xmy6hmg iBVXTmNMjNYgUUG+gunNkTQVyL+p6DYSLU9646vUt9znPN+MoMTovgCjVpKCMmLVKGri USpKDSm5sxZ33DPLZzOeaW14ldttf69BkLnCo1t1G2LwCl8BCUFkycGHIptWxtBOPPCM /Pp42kuwoZgvYhVcFrjlp+MUvW8IaQxrKGSApMKQoo3GtXkR35OoYXjsyjouXjJ9IXzN ORUQ== X-Received: by 10.180.231.4 with SMTP id tc4mr4864603wic.27.1430990563838; Thu, 07 May 2015 02:22:43 -0700 (PDT) Received: from ?IPv6:2620:0:105f:fd00:863a:4bff:fe50:abc4? ([2620:0:105f:fd00:863a:4bff:fe50:abc4]) by mx.google.com with ESMTPSA id n8sm2938570wiy.19.2015.05.07.02.22.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 May 2015 02:22:43 -0700 (PDT) Message-ID: <554B2EDD.5080605@gmail.com> Date: Thu, 07 May 2015 11:22:37 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.6.0 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: [PATCH 3/5] zfs com.delphix:hole_birth feature support References: <35A91AA4-73E2-46D7-8E86-3323C3299DD1@me.com> <20150419171102.6433b4b4@opensuse.site> <20150419175105.0e816053@opensuse.site> <2CB0E10D-6AEF-4345-A3B4-5B62167E9987@me.com> <20150503181505.238adeed@opensuse.site> In-Reply-To: <20150503181505.238adeed@opensuse.site> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="RPr89PTc9QlMph7QEXb5R9eNvt3QNFQR8" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c00::22c X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 May 2015 09:22:48 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --RPr89PTc9QlMph7QEXb5R9eNvt3QNFQR8 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Thank you Toomas for patch and Andrey for reviews. On 03.05.2015 17:15, Andrei Borzenkov wrote: > =D0=92 Sun, 19 Apr 2015 17:57:04 +0300 > Toomas Soome =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >=20 >> >>> On 19.04.2015, at 17:51, Andrei Borzenkov wrote= : >>> >>> =D0=92 Sun, 19 Apr 2015 17:40:16 +0300 >>> Toomas Soome =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >>> >>>> >>>> the features in openzfs have different effects, some affect only wri= tes and are therefore read only compatible - such feature does not need a= ny changes for reads, this feature is not read only compatible and theref= ore, once this feature is enabled, reader code must be changed accordingl= y. >>>> >>>> so, what they did with hole_birth was they started to insert block b= irth timestamps for blocks being released to make it possible to track su= ch blocks while doing zfs send (when block has birth time, you know its p= lace on timeline of snapshots). as old reader code was relying on blk_bir= th =3D=3D 0 to detect an hole, after hole_birth is enabled, hole blk_birt= h is not 0 any more, so the solution is to check if DVA pointers are zero= instead. and thats exactly what its about. =20 >>> >>> And if hole_birth is *not* enabled on a filesystem we are reading? >>> Should not old code be used in this case? >> >> >> not really, as for holes, DVA pointers are zero anyhow. I guess the o= riginal implementation used blk_birth to save extra compare - so the new = read code is compatible with old data. >=20 > Committed with explanatory text for non-insiders. >=20 >> >> >>> >>>> >>>> reference: >>>> https://github.com/illumos/illumos-gate/commit/43466aae47bfcd2ad9bf5= 01faec8e75c08095e4f=20 >>>> >>>> >>>> >>>>> On 19.04.2015, at 17:11, Andrei Borzenkov wro= te: >>>>> >>>>> =D0=92 Thu, 16 Apr 2015 08:22:08 +0300 >>>>> Toomas Soome =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >>>>> >>>>> This really needs better explanation. Otherwise this looks like eit= her >>>>> old code was broken to start with and it is a bug fix or new code n= eeds >>>>> some conditionals on new feature. >>>>> >>>>>> >>>>>> --- >>>>>> grub-core/fs/zfs/zfs.c | 6 ++++-- >>>>>> include/grub/zfs/spa.h | 4 +++- >>>>>> 2 files changed, 7 insertions(+), 3 deletions(-) >>>>>> >>>>>> diff --git a/grub-core/fs/zfs/zfs.c b/grub-core/fs/zfs/zfs.c >>>>>> index 2689986..a731c3d 100644 >>>>>> --- a/grub-core/fs/zfs/zfs.c >>>>>> +++ b/grub-core/fs/zfs/zfs.c >>>>>> @@ -280,7 +280,9 @@ grub_crypto_cipher_handle_t (*grub_zfs_load_ke= y) (const struct grub_zfs_key *key >>>>>> */ >>>>>> #define MAX_SUPPORTED_FEATURE_STRLEN 50 >>>>>> static const char *spa_feature_names[] =3D { >>>>>> - "org.illumos:lz4_compress",NULL >>>>>> + "org.illumos:lz4_compress", >>>>>> + "com.delphix:hole_birth", >>>>>> + NULL >>>>>> }; >>>>>> >>>>>> static int >>>>>> @@ -1751,7 +1753,7 @@ zio_read_gang (blkptr_t * bp, grub_zfs_endia= n_t endian, dva_t * dva, void *buf, >>>>>> >>>>>> for (i =3D 0; i < SPA_GBH_NBLKPTRS; i++) >>>>>> { >>>>>> - if (zio_gb->zg_blkptr[i].blk_birth =3D=3D 0) >>>>>> + if (BP_IS_HOLE(&zio_gb->zg_blkptr[i])) >>>>>> continue; >>>>>> >>>>>> err =3D zio_read_data (&zio_gb->zg_blkptr[i], endian, buf, da= ta); >>>>>> diff --git a/include/grub/zfs/spa.h b/include/grub/zfs/spa.h >>>>>> index 7edb8ab..df43b6b 100644 >>>>>> --- a/include/grub/zfs/spa.h >>>>>> +++ b/include/grub/zfs/spa.h >>>>>> @@ -279,7 +279,9 @@ typedef struct blkptr { >>>>>> >>>>>> #define BP_IDENTITY(bp) (&(bp)->blk_dva[0]) >>>>>> #define BP_IS_GANG(bp) DVA_GET_GANG(BP_IDENTITY(bp)) >>>>>> -#define BP_IS_HOLE(bp) ((bp)->blk_birth =3D=3D 0) >>>>>> +#define DVA_IS_EMPTY(dva) ((dva)->dva_word[0] =3D=3D 0ULL && \ >>>>>> + (dva)->dva_word[1] =3D=3D 0ULL) >>>>>> +#define BP_IS_HOLE(bp) DVA_IS_EMPTY(BP_IDENTITY(bp)) >>>>>> >>>>>> /* BP_IS_RAIDZ(bp) assumes no block compression */ >>>>>> #define BP_IS_RAIDZ(bp) (DVA_GET_ASIZE(&(bp)->blk_dva[0]) > \ >>>>> >>>>> >>>>> _______________________________________________ >>>>> Grub-devel mailing list >>>>> Grub-devel@gnu.org >>>>> https://lists.gnu.org/mailman/listinfo/grub-devel >>>> >>>> >>>> _______________________________________________ >>>> Grub-devel mailing list >>>> Grub-devel@gnu.org >>>> https://lists.gnu.org/mailman/listinfo/grub-devel >> >=20 >=20 > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel >=20 --RPr89PTc9QlMph7QEXb5R9eNvt3QNFQR8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iF4EAREKAAYFAlVLLuIACgkQmBXlbbo5nOtFBQD+P4+andLJwUm2JB4Oc4tF2Ktg 4kqc1JmVs4P5Qck/46cBAJwrNsm2PJpR0rlykoWWEbHoXX1l7Il7yJO3Dm5wU9EX =mCXq -----END PGP SIGNATURE----- --RPr89PTc9QlMph7QEXb5R9eNvt3QNFQR8--