Re: [PATCH 7/8] Make more generic the code for raid6 rebuilding

2018-05-14 Thread Goffredo Baroncelli
On 05/14/2018 08:57 PM, Daniel Kiper wrote: > On Fri, May 11, 2018 at 09:24:45PM +0200, Goffredo Baroncelli wrote: [...] > >> +char *buf, grub_uint64_t sector, grub_size_t size, >> +raid_recover_read_t read_func, int layout

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

2018-05-09 Thread Goffredo Baroncelli
On 05/09/2018 07:00 PM, Daniel Kiper wrote: > On Tue, Apr 24, 2018 at 09:13:09PM +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,

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

2018-05-09 Thread Goffredo Baroncelli
On 05/09/2018 03:52 PM, Daniel Kiper wrote: > On Tue, Apr 24, 2018 at 09:13:11PM +0200, Goffredo Baroncelli wrote: >> This helper was used in few places to help the debugging. As conservative >> approach, in case of error it is only logged. > > Could you explain in the

Re: [PATCH 1/7] Add support for reading a filesystem with a raid5 or raid6 profile.

2018-05-09 Thread Goffredo Baroncelli
On 05/09/2018 03:46 PM, Daniel Kiper wrote: > On Tue, Apr 24, 2018 at 09:13:10PM +0200, Goffredo Baroncelli wrote: >> Signed-off-by: Goffredo Baroncelli <kreij...@inwind.it> >> --- >> grub-core/fs/btrfs.c | 32 >> 1 file changed,

Re: [PATCH 6/7] Add support for recovery for a raid5 btrfs profiles.

2018-05-09 Thread Goffredo Baroncelli
On 05/09/2018 06:46 PM, Daniel Kiper wrote: > On Tue, Apr 24, 2018 at 09:13:15PM +0200, Goffredo Baroncelli wrote: >> Signed-off-by: Goffredo Baroncelli <kreij...@inwind.it> >> --- >> grub-core/fs/btrfs.c | 206 +-- >> 1 f

Re: [PATCH 3/7] Move from the find_device the error logging logic to the callee.

2018-05-09 Thread Goffredo Baroncelli
On 05/09/2018 04:00 PM, Daniel Kiper wrote: > On Tue, Apr 24, 2018 at 09:13:12PM +0200, Goffredo Baroncelli wrote: >> Signed-off-by: Goffredo Baroncelli <kreij...@inwind.it> >> --- >> grub-core/fs/btrfs.c | 6 +++--- >> 1 file changed, 3 insertions(+), 3 deletion

Re: [PATCH 7/7] Add raid6 recovery.

2018-05-09 Thread Goffredo Baroncelli
On 05/09/2018 06:58 PM, Daniel Kiper wrote: > On Tue, Apr 24, 2018 at 09:13:16PM +0200, Goffredo Baroncelli wrote: >> The code origins from "raid6_recovery.c". The code was changed because the >> original one assumed that both the disk address and size are multiple of

Re: [PATCH 5/7] Refactor the code of read from disk

2018-05-09 Thread Goffredo Baroncelli
On 05/09/2018 04:26 PM, Daniel Kiper wrote: > On Tue, Apr 24, 2018 at 09:13:14PM +0200, Goffredo Baroncelli wrote: >> This is a preparatory patch, to help the adding of the raid5/6 recovery code > > OK, but please tell us why this patch is needed? I will put this commit messa

Re: [PATCH 4/7] Avoiding scanning for an already not found device.

2018-05-09 Thread Goffredo Baroncelli
On 05/09/2018 04:07 PM, Daniel Kiper wrote: > On Tue, Apr 24, 2018 at 09:13:13PM +0200, Goffredo Baroncelli wrote: >> If a device is missing, create the entry in data->devices_attached[] array. > > What kind of entry? Invalid one? Please clarify this. > >> This avoid

[PATCH 7/8] Make more generic the code for raid6 rebuilding

2018-05-11 Thread Goffredo Baroncelli
native grub_raid6_recover() code, it is modified to not call grub_diskfilter_read_node directly, but to call an handler passed as argument. Signed-off-by: Goffredo Baroncelli <kreij...@inwind.it> --- grub-core/disk/raid6_recover.c | 52 ++ include/grub/diskfilter

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

2018-05-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 4 patches, are preparatory ones. The 6th patch implements the raid5 recovery

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

2018-05-11 Thread Goffredo Baroncelli
This helper was used in few places to help the debugging. As conservative approach, in case of error it is only logged. This because I was unaware if this could change something the error handling of the previous code. Signed-off-by: Goffredo Baroncelli <kreij...@inwind.it> --- grub-c

[PATCH 8/8] Add raid6 recovery for a btrfs filesystem.

2018-05-11 Thread Goffredo Baroncelli
Add the raid6 recovery, in order to use a raid6 filesystem even if some disks (up to two) are missing. This code use the old md raid6 code already present in grub. Signed-off-by: Goffredo Baroncelli <kreij...@inwind.it> --- grub-core/fs/btrfs.c | 43 +++-

[PATCH 5/8] Refactor the code that read from disk

2018-05-11 Thread Goffredo Baroncelli
-by: Goffredo Baroncelli <kreij...@inwind.it> --- grub-core/fs/btrfs.c | 106 +-- 1 file changed, 61 insertions(+), 45 deletions(-) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c index 32c4382e5..fc4198e39 100644 --- a/grub-core/fs/btrfs.c +++

[PATCH 3/8] Move the error logging logic from find_device() to the callee.

2018-05-11 Thread Goffredo Baroncelli
This is a preparatory patch. The callee knows better if this error is fatal, or if it exists another available disk. Signed-off-by: Goffredo Baroncelli <kreij...@inwind.it> --- grub-core/fs/btrfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/grub-core/fs/btr

[PATCH 1/8] Add support for reading a filesystem with a raid5 or raid6 profile.

2018-05-11 Thread Goffredo Baroncelli
Signed-off-by: Goffredo Baroncelli <kreij...@inwind.it> --- grub-core/fs/btrfs.c | 61 1 file changed, 61 insertions(+) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c index be195448d..7e287d0ec 100644 --- a/grub-core/fs/btrfs.c +++

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

2018-05-11 Thread Goffredo Baroncelli
I was wrong this is the V3 patches set ; the subject is wrong. Sorry for the inconvenient. On 05/11/2018 09:24 PM, 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, im

[PATCH 6/8] Add support for recovery for a raid5 btrfs profiles.

2018-05-11 Thread Goffredo Baroncelli
Signed-off-by: Goffredo Baroncelli <kreij...@inwind.it> --- grub-core/fs/btrfs.c | 178 +-- 1 file changed, 173 insertions(+), 5 deletions(-) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c index fc4198e39..8d72607d1 100644 --- a/grub-c

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

2018-05-11 Thread Goffredo Baroncelli
I was wrong this is the V3 patches set ; the subject is wrong. Sorry for the inconvenient. On 05/11/2018 09:24 PM, 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, im

Re: [PATCH 7/8] Make more generic the code for raid6 rebuilding

2018-05-15 Thread Goffredo Baroncelli
On 05/14/2018 09:07 PM, Daniel Kiper wrote: > On Mon, May 14, 2018 at 08:57:10PM +0200, Daniel Kiper wrote: >> On Fri, May 11, 2018 at 09:24:45PM +0200, Goffredo Baroncelli wrote: [...] >>> static grub_err_t >>> -grub_raid6_recover (struct grub_diskfilter_segment *ar

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

2018-05-16 Thread Goffredo Baroncelli
Signed-off-by: Goffredo Baroncelli <kreij...@inwind.it> --- grub-core/fs/btrfs.c | 174 ++- 1 file changed, 170 insertions(+), 4 deletions(-) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c index 63651928b..5fcaad86f 100644 --- a/grub-c

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

2018-05-16 Thread 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 old md RAID 6 code already present in grub. Signed-off-by: Goffredo Baroncelli <kreij...@inwind.it> --- grub-core/fs/btrfs.

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

2018-05-16 Thread Goffredo Baroncelli
describes the stripe positioning; split the patch #5 in two (#5 and #6) BR G.Baroncelli-- gpg @keyserver.linux.it: Goffredo Baroncelli Key fingerprint BBF5 1610 0B64 DAC6 5F7D 17B2 0EDA 9B37 8B82 E0B5 ___ Grub-devel mailing list Grub-devel@gnu.org

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

2018-05-16 Thread Goffredo Baroncelli
Signed-off-by: Goffredo Baroncelli <kreij...@inwind.it> --- grub-core/fs/btrfs.c | 68 1 file changed, 68 insertions(+) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c index be195448d..394611cbb 100644 --- a/grub-core/fs/btrfs.c +++

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

2018-05-16 Thread Goffredo Baroncelli
This is a preparatory patch. The callee knows better if this error is fatal or not, i.e. another available disk. Signed-off-by: Goffredo Baroncelli <kreij...@inwind.it> --- grub-core/fs/btrfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/grub-core/fs/btrfs.c

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

2018-05-16 Thread Goffredo Baroncelli
If a device is not found, record this failure storing NULL in data->devices_attached[]. This avoid un-necessary devices rescan, speeding the reading in case of a degraded array. Signed-off-by: Goffredo Baroncelli <kreik...@inwind.it> --- grub-core/fs/btrfs.c | 19 +-

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

2018-05-16 Thread Goffredo Baroncelli
-by: Goffredo Baroncelli <kreij...@inwind.it> --- grub-core/fs/btrfs.c | 85 +--- 1 file changed, 49 insertions(+), 36 deletions(-) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c index 51f300829..63651928b 100644 --- a/grub-core/fs/btrfs.c

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

2018-05-16 Thread Goffredo Baroncelli
native grub_raid6_recover() code, it is modified to not call grub_diskfilter_read_node() directly, but to call an handler passed as argument. Signed-off-by: Goffredo Baroncelli <kreij...@inwind.it> --- grub-core/disk/raid6_recover.c | 53 ++ include/grub/diskfilter.h |

Re: [PATCH 6/8] Add support for recovery for a raid5 btrfs profiles.

2018-05-16 Thread Goffredo Baroncelli
On 05/14/2018 08:40 PM, Daniel Kiper wrote: > On Fri, May 11, 2018 at 09:24:44PM +0200, Goffredo Baroncelli wrote: >> Signed-off-by: Goffredo Baroncelli <kreij...@inwind.it> >> --- >> grub-core/fs/btrfs.c | 178 +-- >> 1 f

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

2018-05-16 Thread Goffredo Baroncelli
This helper will be used in few places to help the debugging. As conservative approach, in case of error it is only logged. This because I am not sure if this can change something in the error handling of the currently existing code. Signed-off-by: Goffredo Baroncelli <kreij...@inwind

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

2018-05-16 Thread Goffredo Baroncelli
A portion of the logging code is moved outside a for(;;). The part that is left inside is the one which depends by the for(;;) index. This is a preparatory patch: in the next one it will be possible to refactor the code inside the for(;;) in an another function. --- grub-core/fs/btrfs.c | 25

Re: [PATCH 8/8] Add raid6 recovery for a btrfs filesystem.

2018-05-16 Thread Goffredo Baroncelli
On 05/14/2018 09:06 PM, Daniel Kiper wrote: > On Fri, May 11, 2018 at 09:24:46PM +0200, Goffredo Baroncelli wrote: >> Add the raid6 recovery, in order to use a raid6 filesystem even if some >> disks (up to two) are missing. >> This code use the old md raid6 code al

Re: [PATCH 1/8] Add support for reading a filesystem with a raid5 or raid6 profile.

2018-05-16 Thread Goffredo Baroncelli
On 05/14/2018 07:52 PM, Daniel Kiper wrote: > On Fri, May 11, 2018 at 09:24:39PM +0200, Goffredo Baroncelli wrote: >> Signed-off-by: Goffredo Baroncelli <kreij...@inwind.it> >> --- >> grub-core/fs/btrfs.c | 61 >&g

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

2018-06-18 Thread Goffredo Baroncelli
On 06/14/2018 09:05 PM, Goffredo Baroncelli wrote: >>> + >>> +cleanup: >> Space before the label please. >> I have asked about earlier. > The line before the label is already a space; Am I missing something I think that now I understand: are you requiring a spa

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

2018-06-14 Thread Goffredo Baroncelli
On 06/14/2018 01:45 PM, Daniel Kiper wrote: > On Mon, Jun 04, 2018 at 09:26:06PM +0200, Goffredo Baroncelli wrote: >> Resend this patch because I am not sure that all received it. > > It looks that #4 is a bit unfortunate for you and/or patch series... :-))) Yes, but I have

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

2018-06-14 Thread Goffredo Baroncelli
On 06/14/2018 03:21 PM, Daniel Kiper wrote: > Hi Goffredo, > > On Sun, Jun 03, 2018 at 08:53:39PM +0200, Goffredo Baroncelli wrote: >> >> Hi All, >> >> the aim of this patches set is to provide support for a BTRFS raid5/6 >> filesystem in GRUB. >> >

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

2018-06-14 Thread Goffredo Baroncelli
On 06/14/2018 01:17 PM, Daniel Kiper wrote: > On Sun, Jun 03, 2018 at 08:53:40PM +0200, Goffredo Baroncelli wrote: >> Signed-off-by: Goffredo Baroncelli >> --- >> grub-core/fs/btrfs.c | 70 >> 1 file changed, 70 insertions

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

2018-06-14 Thread Goffredo Baroncelli
On 06/14/2018 03:03 PM, Daniel Kiper wrote: > On Sun, Jun 03, 2018 at 08:53:46PM +0200, Goffredo Baroncelli wrote: >> Add support for recovery fo a RAID 5 btrfs profile. In addition > > s/fo /for / > >> it is added some code as preparatory work for RAID 6 recover

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

2018-06-19 Thread Goffredo Baroncelli
On 06/14/2018 08:55 PM, Goffredo Baroncelli wrote: >>> + * - stripe_offset is the offset from the beginning of the chunk >>> + *disks physical address, >> I am not sure that I understand. Could clarify this? > - stripe_offset is the offset (i

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

2018-06-19 Thread 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 --- grub-core/fs/btrfs.c | 51 ++-- 1 file changed, 45

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

2018-06-19 Thread Goffredo Baroncelli
native grub_raid6_recover() code, it is modified to not call grub_diskfilter_read_node() directly, but to call an handler passed as an argument. Signed-off-by: Goffredo Baroncelli --- grub-core/disk/raid6_recover.c | 52 ++ include/grub/diskfilter.h | 9 ++ 2 files chang

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

2018-06-19 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

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

2018-06-19 Thread Goffredo Baroncelli
Signed-off-by: Goffredo Baroncelli --- grub-core/fs/btrfs.c | 70 1 file changed, 70 insertions(+) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c index be195448d..fbabaebbe 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c

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

2018-06-19 Thread 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 | 177 +-- 1 file changed, 172 insertions(+), 5 deletions

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

2018-06-19 Thread 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 --- grub-core/fs/btrfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs

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

2018-06-19 Thread Goffredo Baroncelli
This helper s used in a few places to help the debugging. As conservative approach the error is only logged. This to not impact the error handling. Signed-off-by: Goffredo Baroncelli --- grub-core/fs/btrfs.c | 24 +++- 1 file changed, 23 insertions(+), 1 deletion(-) diff

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

2018-06-19 Thread 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-off-by: Goffredo

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

2018-06-19 Thread Goffredo Baroncelli
, to help the adding of the RAID 5/6 recovery code. Signed-off-by: Goffredo Baroncelli --- grub-core/fs/btrfs.c | 75 ++-- 1 file changed, 44 insertions(+), 31 deletions(-) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c index 15ed59151..fa5bf56e0 100644

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

2018-06-19 Thread Goffredo Baroncelli
ray. Signed-off-by: Goffredo Baroncelli --- grub-core/fs/btrfs.c | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c index 8d07e2d72..70bcb0fdc 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c @@ -588,7 +58

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

2018-06-03 Thread Goffredo Baroncelli
-by: Goffredo Baroncelli --- grub-core/fs/btrfs.c | 25 ++--- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c index b64b692f8..e2baed665 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c @@ -867,6 +867,18

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

2018-06-03 Thread Goffredo Baroncelli
Add support for recovery fo 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 | 180 +-- 1 file changed, 175 insertions(+), 5 deletions

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

2018-06-03 Thread 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 --- grub-core/fs/btrfs.c | 50 ++-- 1 file changed, 44

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

2018-06-03 Thread Goffredo Baroncelli
the stripe positioning; split the patch #5 in two (#5 and #6) v5: Several spell fix; improved code comment in patch #1, small clean up in the code BR G.Baroncelli -- gpg @keyserver.linux.it: Goffredo Baroncelli Key fingerprint BBF5 1610 0B64 DAC6 5F7D 17B2 0EDA 9B37 8B82 E0B5

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

2018-06-03 Thread Goffredo Baroncelli
the adding of the RAID 5/6 recovery code. Signed-off-by: Goffredo Baroncelli --- grub-core/fs/btrfs.c | 76 ++-- 1 file changed, 45 insertions(+), 31 deletions(-) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c index e2baed665..9cdbfe792 100644

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

2018-06-03 Thread Goffredo Baroncelli
This is a preparatory patch. The caller knows better if this error is fatal or not, i.e. another disk is available or not. Signed-off-by: Goffredo Baroncelli --- grub-core/fs/btrfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs

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

2018-06-03 Thread Goffredo Baroncelli
Signed-off-by: Goffredo Baroncelli --- grub-core/fs/btrfs.c | 70 1 file changed, 70 insertions(+) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c index be195448d..4d418859b 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c

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

2018-06-03 Thread Goffredo Baroncelli
This helper will be used in a few places to help the debugging. As conservative approach, in case of error it is only logged. This is because I am not sure if this can change something in the error handling of the currently existing code. Signed-off-by: Goffredo Baroncelli --- grub-core/fs

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

2018-06-03 Thread Goffredo Baroncelli
native grub_raid6_recover() code, it is modified to not call grub_diskfilter_read_node() directly, but to call an handler passed as an argument. Signed-off-by: Goffredo Baroncelli --- grub-core/disk/raid6_recover.c | 52 ++ include/grub/diskfilter.h | 9 ++ 2 files chang

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

2018-06-04 Thread Goffredo Baroncelli
Resend this patch because I am not sure that all received it. BR G.Baroncelli Forwarded Message Subject: [PATCH 4/9] btrfs: Avoid a rescan for a device which was already not found. Date: Sun, 3 Jun 2018 20:53:43 +0200 From: Goffredo Baroncelli To: grub-devel@gnu.org CC

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

2018-06-01 Thread Goffredo Baroncelli
On 05/30/2018 01:30 PM, Daniel Kiper wrote: > On Wed, May 16, 2018 at 08:48:17PM +0200, Goffredo Baroncelli wrote: >> Signed-off-by: Goffredo Baroncelli >> --- >> grub-core/fs/btrfs.c | 174 ++- >> 1 file changed, 170

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

2018-06-01 Thread Goffredo Baroncelli
On 05/30/2018 02:15 PM, Daniel Kiper wrote: > On Wed, May 16, 2018 at 08:48:19PM +0200, Goffredo Baroncelli wrote: >> 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 old md RAID 6 code already > >

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

2018-06-01 Thread Goffredo Baroncelli
On 05/30/2018 02:05 PM, Daniel Kiper wrote: > On Wed, May 16, 2018 at 08:48:18PM +0200, Goffredo Baroncelli wrote: >> 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 >> assum

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

2018-06-01 Thread Goffredo Baroncelli
Hi Daniel, my comments below On 05/30/2018 12:07 PM, Daniel Kiper wrote: > On Wed, May 16, 2018 at 08:48:11PM +0200, Goffredo Baroncelli wrote: >> Signed-off-by: Goffredo Baroncelli [...] >> + * off -> logical address to read (from the beginning of the >> +

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

2018-06-01 Thread Goffredo Baroncelli
On 05/30/2018 01:07 PM, Daniel Kiper wrote: > On Wed, May 16, 2018 at 08:48:16PM +0200, Goffredo Baroncelli wrote: >> This is a preparatory patch, to help the adding of the RAID 5/6 recovery > > Please move "This is a preparatory patch" sentence below... > >> co

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

2018-07-18 Thread Goffredo Baroncelli
On 07/12/2018 03:46 PM, Daniel Kiper wrote: > On Tue, Jun 19, 2018 at 07:39:48PM +0200, Goffredo Baroncelli wrote: >> Signed-off-by: Goffredo Baroncelli >> --- >> grub-core/fs/btrfs.c | 70 >> 1 file changed, 70 insertions

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

2018-07-18 Thread Goffredo Baroncelli
Resend because I forgot to put grub-devel in cc - On 07/12/2018 04:02 PM, Daniel Kiper wrote: > On Tue, Jun 19, 2018 at 08:22:19PM +0200, Goffredo Baroncelli wrote: >> Forward because this patch still doesn't reach the mai

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

2018-07-08 Thread Goffredo Baroncelli
A gentle ping. BR G.Baroncelli On 06/19/2018 07:39 PM, Goffredo Baroncelli wrote: > Signed-off-by: Goffredo Baroncelli > --- > grub-core/fs/btrfs.c | 70 > 1 file changed, 70 insertions(+) > > diff --git a/grub-core/fs/btrf

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

2018-07-09 Thread Goffredo Baroncelli
On 07/09/2018 12:20 PM, Daniel Kiper wrote: > On Sun, Jul 08, 2018 at 05:51:37PM +0200, Goffredo Baroncelli wrote: >> A gentle ping. > > Sorry for delay. I remember about this patchset but I am swamped with other > stuff. > I will take a look at it this week.

[PATCH 7/7] Add raid6 recovery.

2018-04-24 Thread Goffredo Baroncelli
data from the memory or disk. Signed-off-by: Goffredo Baroncelli <kreij...@inwind.it> --- grub-core/fs/btrfs.c | 211 +-- 1 file changed, 204 insertions(+), 7 deletions(-) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c index 5c76a68f3..

[PATCH 4/7] Avoiding scanning for an already not found device.

2018-04-24 Thread Goffredo Baroncelli
If a device is missing, create the entry in data->devices_attached[] array. This avoid un-necessary devices rescan. Signed-off-by: Goffredo Baroncelli <kreik...@inwind.it> --- grub-core/fs/btrfs.c | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/

[PATCH 3/7] Move from the find_device the error logging logic to the callee.

2018-04-24 Thread Goffredo Baroncelli
Signed-off-by: Goffredo Baroncelli <kreij...@inwind.it> --- grub-core/fs/btrfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c index 01a1fc7a1..745bb854e 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c @@

[PATCH 1/7] Add support for reading a filesystem with a raid5 or raid6 profile.

2018-04-24 Thread Goffredo Baroncelli
Signed-off-by: Goffredo Baroncelli <kreij...@inwind.it> --- grub-core/fs/btrfs.c | 32 1 file changed, 32 insertions(+) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c index be195448d..b0032ea46 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-c

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

2018-04-24 Thread Goffredo Baroncelli
some feedback. I tested the code in grub-emu, and it works (for me) both with all the disks, and with some disks missing. I checked the sh1sums calculated from grub and from linux and these matched. Comments are welcome. BR G.Baroncelli -- gpg @keyserver.linux.it: Goffredo Baroncelli Key

[PATCH 6/7] Add support for recovery for a raid5 btrfs profiles.

2018-04-24 Thread Goffredo Baroncelli
Signed-off-by: Goffredo Baroncelli <kreij...@inwind.it> --- grub-core/fs/btrfs.c | 206 +-- 1 file changed, 199 insertions(+), 7 deletions(-) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c index 697322125..5c76a68f3 100644 --- a/grub-c

[PATCH 5/7] Refactor the code of read from disk

2018-04-24 Thread Goffredo Baroncelli
This is a preparatory patch, to help the adding of the raid5/6 recovery code Signed-off-by: Goffredo Baroncelli <kreij...@inwind.it> --- grub-core/fs/btrfs.c | 111 --- 1 file changed, 62 insertions(+), 49 deletions(-) diff --git a/grub-core/fs/btr

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

2018-04-24 Thread Goffredo Baroncelli
This helper was used in few places to help the debugging. As conservative approach, in case of error it is only logged. Signed-off-by: Goffredo Baroncelli <kreij...@inwind.it> --- grub-core/fs/btrfs.c | 22 +- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git

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

2018-04-23 Thread Goffredo Baroncelli
On 04/23/2018 01:50 PM, Daniel Kiper wrote: > 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 i

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

2018-04-17 Thread Goffredo Baroncelli
. Comments are welcome. BR G.Baroncelli --- commit 8c80a1b7c913faf50f95c5c76b4666ed17685666 Author: Goffredo Baroncelli <kreij...@inwind.it> Date: Tue Apr 17 21:40:31 2018 +0200 Add initial support for btrfs raid5/6 chunk diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c index be1

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

2018-09-27 Thread Goffredo Baroncelli
ved an update to the comment BR G.Baroncelli -- gpg @keyserver.linux.it: Goffredo Baroncelli Key fingerprint BBF5 1610 0B64 DAC6 5F7D 17B2 0EDA 9B37 8B82 E0B5 ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel

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

2018-09-27 Thread Goffredo Baroncelli
From: Goffredo Baroncelli Signed-off-by: Goffredo Baroncelli --- grub-core/fs/btrfs.c | 74 1 file changed, 74 insertions(+) diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c index be195448d..9bc6d399d 100644 --- a/grub-core/fs/btrfs.c +++ b

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

2018-09-27 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

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

2018-09-27 Thread Goffredo Baroncelli
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 device may triggers a rescan. It is the caller who decides if a rescan

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

2018-09-27 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

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

2018-09-27 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 | 160 +-- 1 file changed, 155

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

2018-09-27 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

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

2018-09-27 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

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

2018-09-27 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

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

2018-09-27 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 --- grub-core/fs/btrfs.c | 63

[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 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

[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

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

2018-10-11 Thread Goffredo Baroncelli
celli -- gpg @keyserver.linux.it: Goffredo Baroncelli Key fingerprint BBF5 1610 0B64 DAC6 5F7D 17B2 0EDA 9B37 8B82 E0B5 ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel

[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

[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

[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 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

[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

[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

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

2018-10-18 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 1/9] btrfs: Add support for reading a filesystem with a RAID 5 or RAID 6 profile.

2018-10-18 Thread Goffredo Baroncelli
From: Goffredo Baroncelli Signed-off-by: Goffredo Baroncelli Signed-off-by: Daniel Kiper Reviewed-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

  1   2   >