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

2018-10-11 Thread Nick Terrell
> On Oct 11, 2018, at 11:15 AM, Daniel Kiper wrote: > > 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 als

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

2018-10-11 Thread Goffredo Baroncelli
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 Baroncelli Reviewed-by: Daniel Kiper --- grub-core/fs/btrfs.c | 60 +

[PATCH 6/9] btrfs: Refactor the code that read from disk

2018-10-11 Thread Goffredo Baroncelli
From: Goffredo Baroncelli Move the code in charge to read the data from disk into a separate function. This helps to separate the error handling logic (which depends on the different raid profiles) from the read from disk logic. Refactoring this code increases the general readability too. This i

[PATCH 5/9] btrfs: Move logging code in grub_btrfs_read_logical()

2018-10-11 Thread Goffredo Baroncelli
From: Goffredo Baroncelli A portion of the logging code is moved outside of internal for(;;). The part that is left inside is the one which depends on the internal for(;;) index. This is a preparatory patch. The next one will refactor the code inside the for(;;) into an another function. Signed

[PATCH V9] Add support for BTRFS raid5/6 to GRUB

2018-10-11 Thread Goffredo Baroncelli
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 next 5 patches, are preparatory ones. The 7th patch implements the raid5 recovery for

[PATCH 8/9] btrfs: Make more generic the code for RAID 6 rebuilding

2018-10-11 Thread Goffredo Baroncelli
From: Goffredo Baroncelli The original code which handles the recovery of a RAID 6 disks array assumes that all reads are multiple of 1 << GRUB_DISK_SECTOR_BITS and it assumes that all the I/O is done via the struct grub_diskfilter_segment. This is not true for the btrfs code. In order to reuse t

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

2018-10-11 Thread Goffredo Baroncelli
From: Goffredo Baroncelli Signed-off-by: Goffredo Baroncelli Signed-off-by: Daniel Kiper --- grub-core/fs/btrfs.c | 73 1 file changed, 73 insertions(+) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c index be195448d..933a57d3b 100644 ---

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

2018-10-11 Thread Goffredo Baroncelli
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/btrfs.c | 162 +-- 1 file changed, 157 inse

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

2018-10-11 Thread Goffredo Baroncelli
From: Goffredo Baroncelli Currently read from missing device triggers rescan. However, it is never recorded that the device is missing. So, each read of a missing device triggers rescan again and again. This behavior causes a lot of unneeded rescans leading to huge slowdowns. This patch fixes ab

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

2018-10-11 Thread Goffredo Baroncelli
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 Reviewed-by: Daniel Kiper --- grub-core/fs/btrfs.c | 10 -- 1 file changed, 4 insertions(+), 6 delet

[PATCH 2/9] btrfs: Add helper to check the btrfs header.

2018-10-11 Thread Goffredo Baroncelli
From: Goffredo Baroncelli This helper is used in a few places to help the debugging. As conservative approach the error is only logged. This does not impact the error handling. Signed-off-by: Goffredo Baroncelli Reviewed-by: Daniel Kiper --- grub-core/fs/btrfs.c | 24 +++-

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 Nick Terrell
> On Oct 11, 2018, at 10:55 AM, Daniel Kiper wrote: > > On Tue, Oct 09, 2018 at 04:21:37PM -0700, Nick Terrell wrote: >> Adds zstd support to the btrfs module. >> >> Tested on Ubuntu-18.04 with a btrfs /boot partition with and without zstd >> compression. A test case was also added to the tes

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

2018-10-11 Thread Daniel Kiper
On Tue, Oct 09, 2018 at 04:21:37PM -0700, Nick Terrell wrote: > Adds zstd support to the btrfs module. > > Tested on Ubuntu-18.04 with a btrfs /boot partition with and without zstd > compression. A test case was also added to the test suite that fails before > the patch, and passes after. > > Signe

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

2018-10-11 Thread Daniel Kiper
On Tue, Oct 09, 2018 at 04:21:36PM -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 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 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 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 trigger a rescan. However, it is neve

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 send you updated > comment for appr

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

2018-10-11 Thread Paul Menzel
Dear Nick, Am 10.10.2018 um 22:28 schrieb Nick Terrell: 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 library means, it has to