From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1YjqZ2-0007KE-Ok for mharc-grub-devel@gnu.org; Sun, 19 Apr 2015 10:51:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44500) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YjqYz-0007Jw-R9 for grub-devel@gnu.org; Sun, 19 Apr 2015 10:51:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YjqYv-0001E6-J0 for grub-devel@gnu.org; Sun, 19 Apr 2015 10:51:13 -0400 Received: from mail-lb0-x233.google.com ([2a00:1450:4010:c04::233]:34183) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YjqYv-0001E2-4L for grub-devel@gnu.org; Sun, 19 Apr 2015 10:51:09 -0400 Received: by lbcga7 with SMTP id ga7so113681763lbc.1 for ; Sun, 19 Apr 2015 07:51: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=TUhp64JtjxoPRtX3nw9s06UfZOr2efGfp9ZkJfqh2yM=; b=g/mtxsMVKw8AgzG4MbyJ6Z11muGEqn8WrYCPoc0XCX0zpcchMk0b1zct6DzapnoaNB mR8seOiTuVRrhPzm8KdEtHvYz2Yv8G2L9N97qyInJCZP7dNa5ySCTL7UbJLyFRD1jtO0 ryawJtzHc+RMXURqLfzHNxLf1LJc7eCUg7LuPq4wGr1bGp9nYiC44KEeYMAnE8Nn7PrM GCHNlvnB3HTj13cBJRhis3ah7RjhWm+v8K2354kLS6/rhmEfST0d7UgX0aXesD10rm0L DFnz6UhWaAch+jKKgK1P3dqbNKq7m2GE7VbcjYi5Zc1DXbtPOOU5nTKTFbtGkWBt1atK VLdQ== X-Received: by 10.152.6.34 with SMTP id x2mr11652581lax.47.1429455068118; Sun, 19 Apr 2015 07:51:08 -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 g19sm3713236lbh.13.2015.04.19.07.51.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Apr 2015 07:51:07 -0700 (PDT) Date: Sun, 19 Apr 2015 17:51:05 +0300 From: Andrei Borzenkov To: Toomas Soome Subject: Re: [PATCH 3/5] zfs com.delphix:hole_birth feature support Message-ID: <20150419175105.0e816053@opensuse.site> In-Reply-To: References: <35A91AA4-73E2-46D7-8E86-3323C3299DD1@me.com> <20150419171102.6433b4b4@opensuse.site> 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::233 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, 19 Apr 2015 14:51:14 -0000 =D0=92 Sun, 19 Apr 2015 17:40:16 +0300 Toomas Soome =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >=20 > the features in openzfs have different effects, some affect only writes a= nd are therefore read only compatible - such feature does not need any chan= ges for reads, this feature is not read only compatible and therefore, once= this feature is enabled, reader code must be changed accordingly. >=20 > so, what they did with hole_birth was they started to insert block birth = timestamps for blocks being released to make it possible to track such bloc= ks while doing zfs send (when block has birth time, you know its place on t= imeline 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 an= y more, so the solution is to check if DVA pointers are zero instead. and t= hats 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? >=20 > reference: > https://github.com/illumos/illumos-gate/commit/43466aae47bfcd2ad9bf501fae= c8e75c08095e4f=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 needs > > 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