grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Kiper <dkiper@net-space.pl>
To: Goffredo Baroncelli <kreijack@libero.it>
Cc: grub-devel@gnu.org
Subject: Re: [PATCH 7/9] btrfs: Add support for recovery for a RAID 5 btrfs profiles.
Date: Thu, 18 Oct 2018 11:59:00 +0200	[thread overview]
Message-ID: <20181018095900.GC319@router-fw-old.i.net-space.pl> (raw)
In-Reply-To: <a2e58157-8727-75dc-7dba-f529cbdb8753@libero.it>

On Wed, Oct 17, 2018 at 09:03:58PM +0200, Goffredo Baroncelli wrote:
> On 17/10/2018 16.14, Daniel Kiper wrote:
> > On Thu, Oct 11, 2018 at 08:51:01PM +0200, Goffredo Baroncelli wrote:
> >> From: Goffredo Baroncelli <kreijack@inwind.it>
> >>
> >> 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 <kreijack@inwind.it>
> >> ---
> [...]
>
> >> +
> >> +  for (failed_devices = 0, i = 0; i < nstripes; i++)
> >> +    {
> >> +      struct grub_btrfs_chunk_stripe *stripe;
> >> +      grub_disk_addr_t paddr;
> >> +      grub_device_t dev;
> >> +      grub_err_t err;
> >> +
> >> +      /* after the struct grub_btrfs_chunk_item, there is an array of
> >> +         struct grub_btrfs_chunk_stripe */
> >
> > /* Struct grub_btrfs_chunk_stripe lives behind struct grub_btrfs_chunk_item. */
>
> What about
>
> /* The struct grub_btrfs_chunk_stripe array lives behind struct grub_btrfs_chunk_item. */

Works for me.

> [...]
>
> >> @@ -921,17 +1061,29 @@ grub_btrfs_read_logical (struct grub_btrfs_data *data, grub_disk_addr_t addr,
> >>  	    grub_dprintf ("btrfs", "reading laddr 0x%" PRIxGRUB_UINT64_T "\n",
> >>  			  addr);
> >>
> >> -	    for (i = 0; i < redundancy; i++)
> >> +	    if (!is_raid56)
> >
> > Why not "if (is_raid56)"? I asked about that earlier. Please change
> > this if and of course code below. It will be much easier to read. And
> > you do not need curly brackets for for loop after else.
>
> Frankly speaking I don't see any problem having a if (!...). However I
> update the code as your request, hoping to speedup this patch set

OK, it works. However, if you have "else" below then I think that it is
more natural to drop "!" here. If you would not have else I would not
complain. Well, because it would not make sense to do so... :-)))

Daniel


  reply	other threads:[~2018-10-18 10:22 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-11 18:50 [PATCH V9] Add support for BTRFS raid5/6 to GRUB Goffredo Baroncelli
2018-10-11 18:50 ` [PATCH 1/9] btrfs: Add support for reading a filesystem with a RAID 5 or RAID 6 profile Goffredo Baroncelli
2018-10-17 13:46   ` Daniel Kiper
2018-10-11 18:50 ` [PATCH 2/9] btrfs: Add helper to check the btrfs header Goffredo Baroncelli
2018-10-11 18:50 ` [PATCH 3/9] btrfs: Move the error logging from find_device() to its caller Goffredo Baroncelli
2018-10-11 18:50 ` [PATCH 4/9] btrfs: Avoid a rescan for a device which was already not found Goffredo Baroncelli
2018-10-17 13:51   ` Daniel Kiper
2018-10-11 18:50 ` [PATCH 5/9] btrfs: Move logging code in grub_btrfs_read_logical() Goffredo Baroncelli
2018-10-11 18:51 ` [PATCH 6/9] btrfs: Refactor the code that read from disk Goffredo Baroncelli
2018-10-11 18:51 ` [PATCH 7/9] btrfs: Add support for recovery for a RAID 5 btrfs profiles Goffredo Baroncelli
2018-10-17 14:14   ` Daniel Kiper
2018-10-17 19:03     ` Goffredo Baroncelli
2018-10-18  9:59       ` Daniel Kiper [this message]
2018-10-11 18:51 ` [PATCH 8/9] btrfs: Make more generic the code for RAID 6 rebuilding Goffredo Baroncelli
2018-10-11 18:51 ` [PATCH 9/9] btrfs: Add RAID 6 recovery for a btrfs filesystem Goffredo Baroncelli
2018-10-17 14:23   ` Daniel Kiper
  -- strict thread matches above, loose matches on Subject: below --
2018-10-22 17:29 [PATCH V11] Add support for BTRFS raid5/6 to GRUB Goffredo Baroncelli
2018-10-22 17:29 ` [PATCH 7/9] btrfs: Add support for recovery for a RAID 5 btrfs profiles Goffredo Baroncelli
2018-10-18 17:55 [PATCH V10] Add support for BTRFS raid5/6 to GRUB Goffredo Baroncelli
2018-10-18 17:55 ` [PATCH 7/9] btrfs: Add support for recovery for a RAID 5 btrfs profiles Goffredo Baroncelli
2018-10-22 10:04   ` Daniel Kiper
2018-09-27 18:34 [PATCH V8] Add support for BTRFS raid5/6 to GRUB Goffredo Baroncelli
2018-09-27 18:35 ` [PATCH 7/9] btrfs: Add support for recovery for a RAID 5 btrfs profiles Goffredo Baroncelli
2018-10-09 18:20   ` Daniel Kiper
2018-10-10 13:08     ` Goffredo Baroncelli
2018-09-19 18:40 [PATCH V7] Add support for BTRFS raid5/6 to GRUB Goffredo Baroncelli
2018-09-19 18:40 ` [PATCH 7/9] btrfs: Add support for recovery for a RAID 5 btrfs profiles Goffredo Baroncelli
2018-09-25 19:10   ` Daniel Kiper
2018-09-26 19:55     ` Goffredo Baroncelli
2018-09-27 16:18       ` Daniel Kiper
2018-06-19 17:39 [PATCH V6] Add support for BTRFS raid5/6 to GRUB Goffredo Baroncelli
2018-06-19 17:39 ` [PATCH 7/9] btrfs: Add support for recovery for a RAID 5 btrfs profiles Goffredo Baroncelli
2018-07-12 14:35   ` Daniel Kiper
2018-06-03 18:53 [PATCH V5] Add support for BTRFS raid5/6 to GRUB Goffredo Baroncelli
2018-06-03 18:53 ` [PATCH 7/9] btrfs: Add support for recovery for a RAID 5 btrfs profiles Goffredo Baroncelli
2018-06-14 13:03   ` Daniel Kiper
2018-06-14 19:05     ` Goffredo Baroncelli
2018-06-18 18:12       ` Goffredo Baroncelli
2018-09-03 12:32         ` Daniel Kiper
2018-05-16 18:48 [PATCH V4] Add support for BTRFS raid5/6 to GRUB Goffredo Baroncelli
2018-05-16 18:48 ` [PATCH 7/9] btrfs: add support for recovery for a RAID 5 btrfs profiles Goffredo Baroncelli
2018-05-30 11:30   ` Daniel Kiper
2018-06-01 18:50     ` Goffredo Baroncelli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181018095900.GC319@router-fw-old.i.net-space.pl \
    --to=dkiper@net-space.pl \
    --cc=grub-devel@gnu.org \
    --cc=kreijack@libero.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).