From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Yk2ZX-0004Q2-7G for mharc-grub-devel@gnu.org; Sun, 19 Apr 2015 23:40:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44280) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yk2ZV-0004Pt-7P for grub-devel@gnu.org; Sun, 19 Apr 2015 23:40:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yk2ZQ-0001VM-5z for grub-devel@gnu.org; Sun, 19 Apr 2015 23:40:33 -0400 Received: from mail-la0-x22b.google.com ([2a00:1450:4010:c03::22b]:33786) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yk2ZP-0001TA-Jx for grub-devel@gnu.org; Sun, 19 Apr 2015 23:40:28 -0400 Received: by layy10 with SMTP id y10so117190922lay.0 for ; Sun, 19 Apr 2015 20:40:26 -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=icXZFhHiYxcO6vSi9xX32+E2fFB4NXpw7k48cBl94bQ=; b=TA1oV/TDeJvZD8jAdbySSxV8A8oMVwHaME+sM9RnRyVHl0inVaJiBKOStx/ARJJW7+ Xj1J43ZpqHoGBrvzCFIDLHaowDU8eumTEFKJocxlX8bVtca+HDnzNyJKSMr6e6fjjBQp aqYNVU6C6DuOugk8O5QESuSYEU3DLYolzkmwTLxjw0MXqUq/V+iLiMb4HaYoRukecNmd VV+XsWokpe8uEVqJqrHuqGhd8eHTcRj5YZ7QLKsgIWd31vPuYlCkrDoxO4naOAS26TQC XfkTceb71cmwPu7t0RdkAaIY7eV12MTtkehqUcSm3bfUqg+LJWWDhQza0ZXZM9j/Zm03 jXxQ== X-Received: by 10.152.88.1 with SMTP id bc1mr13909074lab.79.1429501226690; Sun, 19 Apr 2015 20:40:26 -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 jr1sm4025891lbc.43.2015.04.19.20.40.25 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Apr 2015 20:40:25 -0700 (PDT) Date: Mon, 20 Apr 2015 06:40:23 +0300 From: Andrei Borzenkov To: Toomas Soome Subject: Re: [PATCH 5/5] zfs extensible_dataset and large_blocks feature support Message-ID: <20150420064023.277228f2@opensuse.site> In-Reply-To: <9505B405-2124-4FCC-9527-41C5BE5B045A@me.com> References: <20150419224040.44ec3e70@opensuse.site> <9505B405-2124-4FCC-9527-41C5BE5B045A@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:c03::22b 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: Mon, 20 Apr 2015 03:40:34 -0000 =D0=92 Sun, 19 Apr 2015 22:53:35 +0300 Toomas Soome =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >=20 > > On 19.04.2015, at 22:40, Andrei Borzenkov wrote: > >=20 > > =D0=92 Thu, 16 Apr 2015 08:24:38 +0300 > > Toomas Soome =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > >=20 > >>=20 > >=20 > > Could you explain how these changes affect large block read? As far as > > I understand, this feature is basically "for free" - changes were > > needed to allow large block writes, but on disk format already > > supported them so reading should have just worked? > >=20 >=20 >=20 > yes, large block is basically free, but, there are 2 conditions.=20 >=20 > 1. large blocks basically use extensible dataset feature, or to be exact,= setting recordsize above 128k will trigger large_block feature to be enabl= ed and storing such blocks is using feature extensible dataset. so the exte= nsible dataset is prerequisite. >=20 > 2. once large block is enabled, its listed in label as well, and therefor= e it should be listed in spa_feature_names, which is list of supported feat= ures. >=20 > but otherwise, reading large blocks does not require any other changes (a= ssuming there is enough memory to read those blocks). Good. So the means that the only change needed was ... >=20 > rgds, > toomas >=20 >=20 >=20 > >> --- > >> grub-core/fs/zfs/zfs.c | 18 +++++++++++------- > >> 1 file changed, 11 insertions(+), 7 deletions(-) > >>=20 > >> diff --git a/grub-core/fs/zfs/zfs.c b/grub-core/fs/zfs/zfs.c > >> index da44131..4a542e0 100644 > >> --- a/grub-core/fs/zfs/zfs.c > >> +++ b/grub-core/fs/zfs/zfs.c > >> @@ -283,6 +283,8 @@ static const char *spa_feature_names[] =3D { > >> "org.illumos:lz4_compress", > >> "com.delphix:hole_birth", > >> "com.delphix:embedded_data", > >> + "com.delphix:extensible_dataset", > >> + "org.open-zfs:large_blocks", ... this one. What all other changes below do and how they are related to these two features? > >> NULL > >> }; > >>=20 > >> @@ -3080,7 +3082,7 @@ get_filesystem_dnode (dnode_end_t * mosmdn, char= *fsname, > >>=20 > >> grub_dprintf ("zfs", "alive\n"); > >>=20 > >> - err =3D dnode_get (mosmdn, objnum, DMU_OT_DSL_DIR, mdn, data); > >> + err =3D dnode_get (mosmdn, objnum, 0, mdn, data); > >> if (err) > >> return err; > >>=20 > >> @@ -3113,7 +3115,7 @@ get_filesystem_dnode (dnode_end_t * mosmdn, char= *fsname, > >> if (err) > >> return err; > >>=20 > >> - err =3D dnode_get (mosmdn, objnum, DMU_OT_DSL_DIR, mdn, data); > >> + err =3D dnode_get (mosmdn, objnum, 0, mdn, data); > >> if (err) > >> return err; > >>=20 > >> @@ -3268,8 +3270,7 @@ dnode_get_fullpath (const char *fullpath, struct= subvolume *subvol, > >>=20 > >> grub_dprintf ("zfs", "endian =3D %d\n", subvol->mdn.endian); > >>=20 > >> - err =3D dnode_get (&(data->mos), headobj, DMU_OT_DSL_DATASET, &subv= ol->mdn, > >> - data); > >> + err =3D dnode_get (&(data->mos), headobj, 0, &subvol->mdn, data); > >> if (err) > >> { > >> grub_free (fsname); > >> @@ -3665,8 +3666,11 @@ zfs_mount (grub_device_t dev) > >> if (ub->ub_version >=3D SPA_VERSION_FEATURES && > >> check_mos_features(&((objset_phys_t *) osp)->os_meta_dnode,ub_en= dian, > >> data) !=3D 0) > >> - return NULL; > >> -=09 > >> + { > >> + grub_error (GRUB_ERR_BAD_FS, "Unsupported features in pool"); > >> + return NULL; > >> + } > >> + > >> /* Got the MOS. Save it at the memory addr MOS. */ > >> grub_memmove (&(data->mos.dn), &((objset_phys_t *) osp)->os_meta_dno= de, > >> DNODE_SIZE); > >> @@ -3963,7 +3967,7 @@ fill_fs_info (struct grub_dirhook_info *info, > >> { > >> headobj =3D grub_zfs_to_cpu64 (((dsl_dir_phys_t *) DN_BONUS (&md= n.dn))->dd_head_dataset_obj, mdn.endian); > >>=20 > >> - err =3D dnode_get (&(data->mos), headobj, DMU_OT_DSL_DATASET, &= mdn, data); > >> + err =3D dnode_get (&(data->mos), headobj, 0, &mdn, data); > >> if (err) > >> { > >> grub_dprintf ("zfs", "failed here\n"); > >=20 >=20