From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Yovby-0007Oq-NM for mharc-grub-devel@gnu.org; Sun, 03 May 2015 11:15:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34365) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yovbv-0007N2-5u for grub-devel@gnu.org; Sun, 03 May 2015 11:15:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yovbp-0002Wd-5v for grub-devel@gnu.org; Sun, 03 May 2015 11:15:15 -0400 Received: from mail-lb0-x22a.google.com ([2a00:1450:4010:c04::22a]:33959) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yovbo-0002Vp-QA for grub-devel@gnu.org; Sun, 03 May 2015 11:15:09 -0400 Received: by lbcga7 with SMTP id ga7so90737208lbc.1 for ; Sun, 03 May 2015 08:15:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=/sMXqpK/g4not+TQiBmSXFWfx1S8Ey8Y8V1LkiCQ/1I=; b=iCisV++gGMYaL2xzCZo9tyyGwBLl7PP92uOk40GlzaYnn0HZVSdbAXbMDp77YyA4Lo AvN38e68ZQ3ylDyikBNcG74gnfo6BldJT8RiK3kg6qXOdB0wW9jX9XDCFoFUYjEImhUa V4DUVbhGqqMjqkJUYrCZOIk3EqNGy87fDQE+pQZrcu5aT6cnR61wU2yuiWkDwvn3aCbl j5svujvqhaJxh1GODMhMMU1F1hQwfno1adyrhpsVDE1ztoY1W0/tAbi1nJrypxSd2esB Nhp3T4TjmkKTqg4nH3DGLf2NSR9X0387SWuDSu+doWO8HN3XmQhYszy6SkuhbABi4pkJ Nnmw== X-Received: by 10.112.189.102 with SMTP id gh6mr15813193lbc.115.1430666107998; Sun, 03 May 2015 08:15:07 -0700 (PDT) Received: from opensuse.site (ppp91-76-14-38.pppoe.mtu-net.ru. [91.76.14.38]) by mx.google.com with ESMTPSA id h3sm2735265lbj.19.2015.05.03.08.15.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 May 2015 08:15:07 -0700 (PDT) Date: Sun, 3 May 2015 18:15:05 +0300 From: Andrei Borzenkov To: Toomas Soome Subject: Re: [PATCH 3/5] zfs com.delphix:hole_birth feature support Message-ID: <20150503181505.238adeed@opensuse.site> In-Reply-To: <2CB0E10D-6AEF-4345-A3B4-5B62167E9987@me.com> References: <35A91AA4-73E2-46D7-8E86-3323C3299DD1@me.com> <20150419171102.6433b4b4@opensuse.site> <20150419175105.0e816053@opensuse.site> <2CB0E10D-6AEF-4345-A3B4-5B62167E9987@me.com> X-Mailer: Claws Mail 3.11.0 (GTK+ 2.24.27; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::22a Cc: The development of GNU GRUB 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: Sun, 03 May 2015 15:15:16 -0000 =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: > >=20 > > =D0=92 Sun, 19 Apr 2015 17:40:16 +0300 > > Toomas Soome =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > >=20 > >>=20 > >> the features in openzfs have different effects, some affect only write= s and are therefore read only compatible - such feature does not need any c= hanges for reads, this feature is not read only compatible and therefore, o= nce this feature is enabled, reader code must be changed accordingly. > >>=20 > >> so, what they did with hole_birth was they started to insert block bir= th timestamps for blocks being released to make it possible to track such b= locks while doing zfs send (when block has birth time, you know its place o= n timeline of snapshots). as old reader code was relying on blk_birth =3D= =3D 0 to detect an hole, after hole_birth is enabled, hole blk_birth is not= 0 any more, so the solution is to check if DVA pointers are zero instead. = and thats exactly what its about. =20 > >=20 > > And if hole_birth is *not* enabled on a filesystem we are reading? > > Should not old code be used in this case? >=20 >=20 > not really, as for holes, DVA pointers are zero anyhow. I guess the orig= inal implementation used blk_birth to save extra compare - so the new read = code is compatible with old data. Committed with explanatory text for non-insiders. >=20 >=20 > >=20 > >>=20 > >> reference: > >> https://github.com/illumos/illumos-gate/commit/43466aae47bfcd2ad9bf501= faec8e75c08095e4f=20 > >>=20 > >>=20 > >>=20 > >>> On 19.04.2015, at 17:11, Andrei Borzenkov wrote: > >>>=20 > >>> =D0=92 Thu, 16 Apr 2015 08:22:08 +0300 > >>> Toomas Soome =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > >>>=20 > >>> This really needs better explanation. Otherwise this looks like either > >>> old code was broken to start with and it is a bug fix or new code nee= ds > >>> some conditionals on new feature. > >>>=20 > >>>>=20 > >>>> --- > >>>> grub-core/fs/zfs/zfs.c | 6 ++++-- > >>>> include/grub/zfs/spa.h | 4 +++- > >>>> 2 files changed, 7 insertions(+), 3 deletions(-) > >>>>=20 > >>>> 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_key)= (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 > >>>> }; > >>>>=20 > >>>> static int > >>>> @@ -1751,7 +1753,7 @@ zio_read_gang (blkptr_t * bp, grub_zfs_endian_= t endian, dva_t * dva, void *buf, > >>>>=20 > >>>> 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; > >>>>=20 > >>>> err =3D zio_read_data (&zio_gb->zg_blkptr[i], endian, buf, data= ); > >>>> 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 { > >>>>=20 > >>>> #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)) > >>>>=20 > >>>> /* BP_IS_RAIDZ(bp) assumes no block compression */ > >>>> #define BP_IS_RAIDZ(bp) (DVA_GET_ASIZE(&(bp)->blk_dva[0]) > \ > >>>=20 > >>>=20 > >>> _______________________________________________ > >>> 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