Re: [PATCH v7 0/2] btrfs: Add zstd support to grub btrfs

2018-11-27 Thread Daniel Kiper
On Tue, Nov 27, 2018 at 02:55:33AM +, Nick Terrell wrote: > > On Nov 19, 2018, at 12:34 PM, Daniel Kiper wrote: > > On Mon, Nov 19, 2018 at 11:20:06AM -0800, Nick Terrell wrote: > >> Hi all, > >> > >> This patch set imports the upstream zstd library, add

Re: [PATCH v7 0/2] btrfs: Add zstd support to grub btrfs

2018-11-19 Thread Daniel Kiper
On Mon, Nov 19, 2018 at 11:20:06AM -0800, Nick Terrell wrote: > Hi all, > > This patch set imports the upstream zstd library, adds zstd support to the > btrfs module, and adds a test case. I've also tested the patch set by storing > my boot partition in btrfs with and without zstd compression and r

Re: [PATCH v6 2/2] btrfs: Add zstd support to grub btrfs

2018-11-19 Thread Daniel Kiper
On Mon, Nov 19, 2018 at 03:22:51PM +0100, Daniel Kiper wrote: > On Thu, Nov 15, 2018 at 02:36:03PM -0800, Nick Terrell wrote: > > - Adds zstd support to the btrfs module. > > - Adds a test case for btrfs zstd support. > > - Changes top_srcdir to srcdir in the btrfs

Re: [PATCH v6 2/2] btrfs: Add zstd support to grub btrfs

2018-11-19 Thread Daniel Kiper
On Thu, Nov 15, 2018 at 02:36:03PM -0800, Nick Terrell wrote: > - Adds zstd support to the btrfs module. > - Adds a test case for btrfs zstd support. > - Changes top_srcdir to srcdir in the btrfs module's lzo include > following comments from Daniel Kiper about the zstd inclu

Re: [PATCH v5 2/2] btrfs: Add zstd support to grub btrfs

2018-11-13 Thread Daniel Kiper
On Mon, Nov 12, 2018 at 02:14:46PM -0800, Nick Terrell wrote: > - Adds zstd support to the btrfs module. > - Adds a test case for btrfs zstd support. > - Changes top_srcdir to srcdir in the btrfs module's lzo include > following comments from Daniel Kiper about the zstd inclu

Re: [PATCH v5 1/2] Import upstream zstd-1.3.6

2018-11-13 Thread Daniel Kiper
_LIB="grub-core/lib/zstd" > rm -rf $DST_LIB > mkdir -p $DST_LIB > cp $SRC_LIB/zstd.h $DST_LIB/ > cp $SRC_LIB/common/*.[hc] $DST_LIB/ > cp $SRC_LIB/decompress/*.[hc] $DST_LIB/ > rm $DST_LIB/{pool.[hc],threading.[hc]} > rm -rf zstd-1.3.6* > echo SUCCESS! > ``` > > Signed-off-by: Nick Terrell Reviewed-by: Daniel Kiper Daniel

Re: [PATCH V10] Add support for BTRFS raid5/6 to GRUB

2018-11-09 Thread Daniel Kiper
On Wed, Oct 31, 2018 at 07:48:08PM +0100, Goffredo Baroncelli wrote: > On 31/10/2018 13.06, Daniel Kiper wrote: > [...] > > > > v11 pushed. > > > > Goffredo, thank you for doing the work. > > Great ! Many thanks for your support !! You are welcome! Daniel

Re: [PATCH v4 1/2] Import upstream zstd-1.3.6

2018-11-07 Thread Daniel Kiper
On Tue, Nov 06, 2018 at 07:43:04PM +, Nick Terrell wrote: > > On Nov 6, 2018, at 6:48 AM, Daniel Kiper wrote: > > On Wed, Oct 31, 2018 at 10:56:16AM -0700, Nick Terrell wrote: > >> Import zstd-1.3.6 from upstream [1]. Only the files need for decompression > >> ar

Re: [PATCH v4 2/2] btrfs: Add zstd support to grub btrfs

2018-11-06 Thread Daniel Kiper
nd passes after. > > Signed-off-by: Nick Terrell > --- > v1 -> v2: > - Fix comments from Daniel Kiper. > > v2 -> v3: > - Use grub_error() to set grub_errno in grub_btrfs_zstd_decompress(). > - Fix style and formatting comments. > > v3 -> v4: > - Use attribute

Re: [PATCH v4 1/2] Import upstream zstd-1.3.6

2018-11-06 Thread Daniel Kiper
On Wed, Oct 31, 2018 at 10:56:16AM -0700, Nick Terrell wrote: > Import zstd-1.3.6 from upstream [1]. Only the files need for decompression > are imported. Additionally makes zstd a module by adding module.c which > contains the license, and updates Makefile.core.def. > > I used the latest zstd rele

Re: [PATCH V10] Add support for BTRFS raid5/6 to GRUB

2018-10-31 Thread Daniel Kiper
On Mon, Oct 22, 2018 at 07:49:40PM +, Nick Terrell wrote: > > > > On Oct 22, 2018, at 4:02 AM, Daniel Kiper wrote: > > > > On Thu, Oct 18, 2018 at 07:55:32PM +0200, Goffredo Baroncelli wrote: > >> > >> Hi All, > >> > >> the aim o

Re: [PATCH V10] Add support for BTRFS raid5/6 to GRUB

2018-10-22 Thread Daniel Kiper
On Thu, Oct 18, 2018 at 07:55:32PM +0200, Goffredo Baroncelli wrote: > > Hi All, > > the aim of this patches set is to provide support for a BTRFS raid5/6 > filesystem in GRUB. > > The first patch, implements the basic support for raid5/6. I.e this works when > all the disks are present. > > The ne

Re: [PATCH 7/9] btrfs: Add support for recovery for a RAID 5 btrfs profiles.

2018-10-22 Thread Daniel Kiper
+ continue; > + } > + > + err = grub_disk_read (dev->disk, paddr >> GRUB_DISK_SECTOR_BITS, > + paddr & (GRUB_DISK_SECTOR_SIZE - 1), > + csize, buffers[i].buf); > + if (err == GRUB_ERR_NONE) > + { > + buffers[i].data_is_valid = 1; > + grub_dprintf ("btrfs", "stripe %" PRIuGRUB_UINT64_T " OK (dev ID %" > + PRIxGRUB_UINT64_T ")\n", i, stripe->device_id); > + } > + else > + { > + buffers[i].data_is_valid = 0; ...this. grub_zalloc() above did work for you. > + grub_dprintf ("btrfs", "stripe %" PRIuGRUB_UINT64_T > + " FAILED (dev ID %" PRIxGRUB_UINT64_T ")\n", i, s/FAILED/READ FAILED/ Otherwise Reviewed-by: Daniel Kiper Daniel

Re: [PATCH 9/9] btrfs: Add RAID 6 recovery for a btrfs filesystem.

2018-10-17 Thread Daniel Kiper
gned-off-by: Goffredo Baroncelli > Reviewed-by: Daniel Kiper > --- > grub-core/fs/btrfs.c | 60 +++- > 1 file changed, 54 insertions(+), 6 deletions(-) > > diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c > index d066d54cc..d20

Re: [PATCH 7/9] btrfs: Add support for recovery for a RAID 5 btrfs profiles.

2018-10-17 Thread Daniel Kiper
On Thu, Oct 11, 2018 at 08:51:01PM +0200, Goffredo Baroncelli wrote: > From: Goffredo Baroncelli > > Add support for recovery for a RAID 5 btrfs profile. In addition > it is added some code as preparatory work for RAID 6 recovery code. > > Signed-off-by: Goffredo Baroncelli > --- > grub-core/fs/

Re: [PATCH 4/9] btrfs: Avoid a rescan for a device which was already not found.

2018-10-17 Thread Daniel Kiper
found for a given > device. This means that only first time read triggers rescan. > > The patch drops premature return. This way data->devices_attached[] is > filled even when a given device is missing. > > Signed-off-by: Goffredo Baroncelli I changed commit message, so, y

Re: [PATCH 1/9] btrfs: Add support for reading a filesystem with a RAID 5 or RAID 6 profile.

2018-10-17 Thread Daniel Kiper
On Thu, Oct 11, 2018 at 08:50:55PM +0200, Goffredo Baroncelli wrote: > From: Goffredo Baroncelli > > Signed-off-by: Goffredo Baroncelli > Signed-off-by: Daniel Kiper One nit pick below... Otherwise you can add Reviewed-by: Daniel Kiper > --- > grub-co

Re: [PATCH v3 0/2] btrfs: Add zstd support to grub btrfs

2018-10-11 Thread Daniel Kiper
Hi Nick, CC-ing Goffredo. On Tue, Oct 09, 2018 at 04:21:35PM -0700, Nick Terrell wrote: > Hi all, > > This patch set imports the upstream zstd library, adds zstd support to the > btrfs module, and adds a test case. I've also tested the patch set by storing > my boot partition in btrfs with and wi

Re: [PATCH v3 2/2] btrfs: Add zstd support to grub btrfs

2018-10-11 Thread Daniel Kiper
nd passes after. > > Signed-off-by: Nick Terrell > --- > v1 -> v2: > - Fix comments from Daniel Kiper. > > v2 -> v3: > - Use grub_error() to set grub_errno in grub_btrfs_zstd_decompress(). > - Fix style and formatting comments. > > Makefile.util.def| 10 +

Re: [PATCH v3 1/2] Import upstream zstd-1.3.6

2018-10-11 Thread Daniel Kiper
IB > mkdir -p $DST_LIB > cp $SRC_LIB/zstd.h $DST_LIB/ > cp $SRC_LIB/common/*.[hc] $DST_LIB/ > cp $SRC_LIB/decompress/*.[hc] $DST_LIB/ > rm $DST_LIB/{pool.[hc],threading.[hc]} > rm -rf zstd-1.3.6* > echo SUCCESS! > --- Ditto. > Signed-off-by: Nick Terrell If you fix things above you can add Reviewed-by: Daniel Kiper Daniel

Re: [PATCH v3 0/2] btrfs: Add zstd support to grub btrfs

2018-10-11 Thread Daniel Kiper
On Wed, Oct 10, 2018 at 08:28:27PM +, Nick Terrell wrote: > > On Oct 10, 2018, at 12:34 AM, Paul Menzel wrote: > > > > Sorry for being ignorant, but you explain, why the library needs to be > > imported and it is not enough to use that library as an external dependency? > > > > Importing the

Re: [PATCH 4/9] btrfs: Avoid a rescan for a device which was already not found.

2018-10-11 Thread Daniel Kiper
On Tue, Oct 09, 2018 at 07:56:43PM +0200, Daniel Kiper wrote: > On Thu, Sep 27, 2018 at 08:34:59PM +0200, Goffredo Baroncelli wrote: > > From: Goffredo Baroncelli > > > > Change the behavior of find_device(): before the patch, a read of a missed > > device may trigg

Re: [PATCH V8] Add support for BTRFS raid5/6 to GRUB

2018-10-11 Thread Daniel Kiper
On Thu, Sep 27, 2018 at 08:34:55PM +0200, Goffredo Baroncelli wrote: > > i All, > > the aim of this patches set is to provide support for a BTRFS raid5/6 > filesystem in GRUB. I have sent you updated comment and commit message. Please double check it. If everything is OK please repost whole series

Re: [PATCH 1/9] btrfs: Add support for reading a filesystem with a RAID 5 or RAID 6 profile.

2018-10-11 Thread Daniel Kiper
On Tue, Oct 09, 2018 at 07:51:01PM +0200, Daniel Kiper wrote: > On Thu, Sep 27, 2018 at 08:34:56PM +0200, Goffredo Baroncelli wrote: > > From: Goffredo Baroncelli > > > > Signed-off-by: Goffredo Baroncelli > > Code LGTM. Though comment begs improvement. I will sen

Re: [PATCH v2 1/2] Import upstream zstd-1.3.6

2018-10-09 Thread Daniel Kiper
On Mon, Oct 08, 2018 at 04:06:20PM -0700, Nick Terrell wrote: > Import zstd-1.3.6 from upstream [1]. Only the files need for decompression > are imported. > > I used the latest zstd release, which includes patches [2] to build cleanly > in GRUB. > > Upstream zstd commit hash: 4fa456d7f12f8b27bd3b2f

Re: [PATCH 7/9] btrfs: Add support for recovery for a RAID 5 btrfs profiles.

2018-10-09 Thread Daniel Kiper
On Thu, Sep 27, 2018 at 08:35:02PM +0200, Goffredo Baroncelli wrote: > From: Goffredo Baroncelli > > Add support for recovery for a RAID 5 btrfs profile. In addition > it is added some code as preparatory work for RAID 6 recovery code. > > Signed-off-by: Goffredo Baroncelli > --- > grub-core/fs/

Re: [PATCH v2 2/2] btrfs: Add zstd support to grub btrfs

2018-10-09 Thread Daniel Kiper
ion with and without zstd > compression. A test case was also added to the test suite that fails before > the patch, and passes after. > > Signed-off-by: Nick Terrell > --- > v1 -> v2: > - Fix comments from Daniel Kiper > > Makefile.util.def| 10 +++- >

Re: [PATCH 9/9] btrfs: Add RAID 6 recovery for a btrfs filesystem.

2018-10-09 Thread Daniel Kiper
gned-off-by: Goffredo Baroncelli Reviewed-by: Daniel Kiper Daniel

Re: [PATCH 4/9] btrfs: Avoid a rescan for a device which was already not found.

2018-10-09 Thread Daniel Kiper
On Thu, Sep 27, 2018 at 08:34:59PM +0200, Goffredo Baroncelli wrote: > From: Goffredo Baroncelli > > Change the behavior of find_device(): before the patch, a read of a missed > device may trigger a rescan. However, it is never recorded that a device > is missed, so each single read of a missed de

Re: [PATCH 1/9] btrfs: Add support for reading a filesystem with a RAID 5 or RAID 6 profile.

2018-10-09 Thread Daniel Kiper
On Thu, Sep 27, 2018 at 08:34:56PM +0200, Goffredo Baroncelli wrote: > From: Goffredo Baroncelli > > Signed-off-by: Goffredo Baroncelli Code LGTM. Though comment begs improvement. I will send you updated comment for approval shortly. Daniel

Re: [PATCH 9/9] btrfs: Add RAID 6 recovery for a btrfs filesystem.

2018-09-27 Thread Daniel Kiper
On Wed, Sep 26, 2018 at 09:56:07PM +0200, Goffredo Baroncelli wrote: > On 25/09/2018 21.20, Daniel Kiper wrote: > > On Wed, Sep 19, 2018 at 08:40:40PM +0200, Goffredo Baroncelli wrote: > >> From: Goffredo Baroncelli > >> > [] > >>

Re: [PATCH 7/9] btrfs: Add support for recovery for a RAID 5 btrfs profiles.

2018-09-27 Thread Daniel Kiper
On Wed, Sep 26, 2018 at 09:55:57PM +0200, Goffredo Baroncelli wrote: > On 25/09/2018 21.10, Daniel Kiper wrote: > > On Wed, Sep 19, 2018 at 08:40:38PM +0200, Goffredo Baroncelli wrote: > >> From: Goffredo Baroncelli > >> > >> Add support for recovery for

Re: [PATCH 4/9] btrfs: Avoid a rescan for a device which was already not found.

2018-09-27 Thread Daniel Kiper
On Wed, Sep 26, 2018 at 09:55:54PM +0200, Goffredo Baroncelli wrote: > On 25/09/2018 19.29, Daniel Kiper wrote: > > On Wed, Sep 19, 2018 at 08:40:35PM +0200, Goffredo Baroncelli wrote: > >> From: Goffredo Baroncelli > >> > >> If a device is not found, do no

Re: [PATCH 1/9] btrfs: Add support for reading a filesystem with a RAID 5 or RAID 6 profile.

2018-09-27 Thread Daniel Kiper
On Wed, Sep 26, 2018 at 10:40:32PM +0200, Goffredo Baroncelli wrote: > On 25/09/2018 17.31, Daniel Kiper wrote: > > On Wed, Sep 19, 2018 at 08:40:32PM +0200, Goffredo Baroncelli wrote: > >> From: Goffredo Baroncelli > >> > >> Signed-off-by: Goffredo Baroncelli

Re: [PATCH 9/9] btrfs: Add RAID 6 recovery for a btrfs filesystem.

2018-09-25 Thread Daniel Kiper
On Wed, Sep 19, 2018 at 08:40:40PM +0200, Goffredo Baroncelli wrote: > From: Goffredo Baroncelli > > Add the RAID 6 recovery, in order to use a RAID 6 filesystem even if some > disks (up to two) are missing. This code use the md RAID 6 code already > present in grub. > > Signed-off-by: Goffredo Ba

Re: [PATCH 7/9] btrfs: Add support for recovery for a RAID 5 btrfs profiles.

2018-09-25 Thread Daniel Kiper
On Wed, Sep 19, 2018 at 08:40:38PM +0200, Goffredo Baroncelli wrote: > From: Goffredo Baroncelli > > Add support for recovery for a RAID 5 btrfs profile. In addition > it is added some code as preparatory work for RAID 6 recovery code. > > Signed-off-by: Goffredo Baroncelli > --- > grub-core/fs/

Re: [PATCH 4/9] btrfs: Avoid a rescan for a device which was already not found.

2018-09-25 Thread Daniel Kiper
On Wed, Sep 19, 2018 at 08:40:35PM +0200, Goffredo Baroncelli wrote: > From: Goffredo Baroncelli > > If a device is not found, do not return immediately but > record this failure by storing NULL in data->devices_attached[]. Still the same question: Where the store happens in the code? I cannot fi

Re: [PATCH 3/9] btrfs: Move the error logging from find_device() to its caller.

2018-09-25 Thread Daniel Kiper
On Wed, Sep 19, 2018 at 08:40:34PM +0200, Goffredo Baroncelli wrote: > From: Goffredo Baroncelli > > The caller knows better if this error is fatal or not, i.e. another disk is > available or not. > > This is a preparatory patch. > > Signed-off-by: Goffredo Baroncelli >

Re: [PATCH 1/9] btrfs: Add support for reading a filesystem with a RAID 5 or RAID 6 profile.

2018-09-25 Thread Daniel Kiper
On Wed, Sep 19, 2018 at 08:40:32PM +0200, Goffredo Baroncelli wrote: > From: Goffredo Baroncelli > > Signed-off-by: Goffredo Baroncelli > --- > grub-core/fs/btrfs.c | 66 > 1 file changed, 66 insertions(+) > > diff --git a/grub-core/fs/btrfs.c b/grub-

Re: [PATCH 3/3] btrfs: Add zstd support to btrfs

2018-09-21 Thread Daniel Kiper
On Mon, Aug 27, 2018 at 06:36:54PM -0700, Nick Terrell wrote: > Adds zstd support to the btrfs module. I'm not sure that my changes to the > Makefiles are correct, please let me know if I need to do something > differently. > > Tested on Ubuntu-18.04 with a btrfs /boot partition with and without zs

Re: [PATCH 2/3] btrfs: Patch the kernel zstd

2018-09-21 Thread Daniel Kiper
On Mon, Aug 27, 2018 at 06:36:53PM -0700, Nick Terrell wrote: > Applies patches to the upstream kernel zstd needed to compile in grub. > * Replace kernel headers with "kerncompat.h". > * Replace the unaligned memory access functions. > * Add fallthrough statements for newer gcc versions. > * Rename

Re: [PATCH 1/3] btrfs: Import kernel zstd

2018-09-21 Thread Daniel Kiper
On Mon, Aug 27, 2018 at 06:36:52PM -0700, Nick Terrell wrote: > Import xxhash and zstd from the upstream kernel as-is. This will not > compile. The next patch in the series contains all the changes needed to > make zstd compile in grub. Only the files needed for decompression are > imported from zs

Re: [RFC] Add support for BTRFS raid5/6 to GRUB

2018-04-23 Thread Daniel Kiper
On Tue, Apr 17, 2018 at 09:57:40PM +0200, Goffredo Baroncelli wrote: > Hi All, > > Below you can find a patch to add support for accessing files from > grub in a RAID5/6 btrfs filesystem. This is a RFC because it is > missing the support for recovery (i.e. if some devices are missed). In > the next