Received: from list by lists.gnu.org with archive (Exim 4.71) id 1fB3NZ-0001rY-65 for mharc-grub-devel@gnu.org; Tue, 24 Apr 2018 15:13:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54039) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fB3NW-0001qr-Mg for grub-devel@gnu.org; Tue, 24 Apr 2018 15:13:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fB3NS-0005oF-M7 for grub-devel@gnu.org; Tue, 24 Apr 2018 15:13:26 -0400 Received: from mail-wr0-x232.google.com ([2a00:1450:400c:c0c::232]:41700) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fB3NS-0005nv-FT for grub-devel@gnu.org; Tue, 24 Apr 2018 15:13:22 -0400 Received: by mail-wr0-x232.google.com with SMTP id g21-v6so23540851wrb.8 for ; Tue, 24 Apr 2018 12:13:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=vpV8oc22TBKmmV9iqV8zlikei56F/nqG0yovCPR8tTs=; b=ZaWLYEs4ps7lumHauU0YZLjJyVG0XpA6WLt/jZWnMVur6mn9DyHCyHYWqcmU5btlei FhJNXNSk4o9SktuqyEyTzAgDZX2s77Fk3U+O8AkT/M0GIZeaEXgQ0MCqHwmjDA6pxMe4 7BMfabv1PMCX7lvy8g5/RqFihA8BMfzfIs6DwIOONS3JPbk9lALkNPdUErz+c1dQJAHQ Ek6WmaDFUxiQ2i7nQhVp4r7N8CXsmKCTHUuBGmd343SGOakwME1Owi8lU805CQWMMDSJ CpEf4tLGskv5fkfsfDIQ04Nglm2RXhDzgsYRd3D6Y3qZ5ysK7SEiFtGmM3f1DJZ0vMO0 MT+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=vpV8oc22TBKmmV9iqV8zlikei56F/nqG0yovCPR8tTs=; b=umpg05Iv5Wy7qOiLGcSYfZRseLVLNdRJ+HxTQIRFuAgZr4azAjZ7CxBouJLBPWdZQR v6aT4h6W3bQNNGThMk0mkesaAX5Os74gsYVP9RI/w+PubMkfryIP/GvAlgWAvjo/vbxg ASiVLhKsbvjQULB7ZiFmjhPnJXzvPFTbOALDk2eVWMxVI4haw4yaHhK0QIgYhD8TM0VR DD3zlIE3dw6kURslPfsuccURe+iH2/96HPL/o13vUYcBiVzjbzXRwLZFdmpzbpnsIGzL RdLHJK5kCpq620P9baGSrbFFNB1deCfMGzIZgBn1bBmykTYMZbgOZ6PxP+xnfz9rBxvz 7/yQ== X-Gm-Message-State: ALQs6tA/6CmtQisD1f3I1UlSzbj2dPI3vKMJXJM+fj1bWQRROQYAXE0C V2MrOERwgvDO3P+BEQuPkIWFZg== X-Google-Smtp-Source: AIpwx49JkIWBDUdcmq81zbb9dFSkLAo6xhDc1Yy+/vL4Jkg6q9HAtnsr+riegAxh4AJdkEbnu7FNUw== X-Received: by 2002:adf:86b2:: with SMTP id 47-v6mr21975037wrx.256.1524597201151; Tue, 24 Apr 2018 12:13:21 -0700 (PDT) Received: from venice.bhome (94-38-18-113.adsl-ull.clienti.tiscali.it. [94.38.18.113]) by smtp.gmail.com with ESMTPSA id w186sm11049733wmw.27.2018.04.24.12.13.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Apr 2018 12:13:20 -0700 (PDT) From: Goffredo Baroncelli X-Google-Original-From: Goffredo Baroncelli To: grub-devel@gnu.org Subject: [PATCH V2] Add support for BTRFS raid5/6 to GRUB Date: Tue, 24 Apr 2018 21:13:09 +0200 Message-Id: <20180424191316.11031-1-kreijack@inwind.it> X-Mailer: git-send-email 2.17.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::232 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 19:13:27 -0000 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 last two implements the support for raid5/6 recovery. It allow to read from the filesystem even when 1 or 2 (for raid 6) disk(s) are missing. The last one is the more controversial. The code for the raid6 recovery is copied from the GRUB file reaid6_recovery.c . I preferred this approach, because the original code assumes that the read is GRUB_DISK_SECTOR_SIZE bytes based (512 bytes). Instead the GRUB BTRFS implementation need to read the disk with a granularity of the byte. I tried to update the code (and the function which the code calls), but the change was quite invasive. So for now I preferred to duplicating the code, to get 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 fingerprint BBF5 1610 0B64 DAC6 5F7D 17B2 0EDA 9B37 8B82 E0B5