Received: from list by lists.gnu.org with archive (Exim 4.71) id 1fVKbz-00010U-HF for mharc-grub-devel@gnu.org; Tue, 19 Jun 2018 13:40:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48358) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVKbx-0000xB-It for grub-devel@gnu.org; Tue, 19 Jun 2018 13:40:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fVKbu-0007Uh-BX for grub-devel@gnu.org; Tue, 19 Jun 2018 13:40:09 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:52722) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fVKbu-0007UF-40 for grub-devel@gnu.org; Tue, 19 Jun 2018 13:40:06 -0400 Received: by mail-wm0-x242.google.com with SMTP id p126-v6so1738421wmb.2 for ; Tue, 19 Jun 2018 10:40:05 -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=XP/ej8DvWnwPNuPkEbb7/XuokZNmNZuKrKe5jAQ5Yp0=; b=gu3qi+3R+TCD/hOfmkHC8z7COCSiHOaOTkytq2CaLij8UIxOdF54KZakoqOxbyJJvl sXuBCq+szJWBlrKZB9FceY98ja8MOXwevLQuo1pWf9avu/V+UgfFTZlIfgv5g3KF9G6i uEnJryC0ABua3GV+9s/JEdHxIvv4VhIP15n/XJE2nX00lqvU4pdgoMpM5NXKlFGRqsU1 9jwkSL3KGlQO9qjX6XQzt6PuNQz/eOriuQ75e7eDaqENAETAls1qUsZDzNz2tJ/EmcLF j1HvrJfcdhml0whI1g9wbCjfDTkw85Lai5fLdOps/585GZmsZ4LMaQEMRcXrHc4oY8ax ofmw== 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=XP/ej8DvWnwPNuPkEbb7/XuokZNmNZuKrKe5jAQ5Yp0=; b=i2V21HpAO4Na2q5dW2KSnZIifxYScOQr9pANa5O0oL+vMm80d0jhsqzxF+KDGbDmh5 bFctUYGMbBvOIps7z8GduPkduhyO7oGWZKPiJpSmXfSbRIa4cEdLMGdCU/uytqCdG93x XNrDUO/Otnf4WMDYQvtJyaYC8jG/mSCbT+E5y6nIQUf9kdrxrdvZcbgHhHEt1dp0M8EX ryf0WeEcZqD5OfqFPE5BTQtFW8THVuhAOnnxa7RdhvzJRwOY3LKRHUmJNYRIveB4w97q ranS/jIPDtJpZmxBCmMI9EqzfuyE6qGRnjqxiC3PN1uK+Y7MvugZvEiSI/mlxGJiEuw9 Fv1g== X-Gm-Message-State: APt69E10HCRADSx217GAzwSx/N3ui2dm0loa9D6P0SlwvsFMRAaG0YFz TQFjz63h9vgt+Tn3Yt/vKtQVxg== X-Google-Smtp-Source: ADUXVKJyUYY+T6XCQpY6qnzKYBrjnLFMpdk1YNt6S7GQM7MvLZNE7/MyRNZd8ZoyLaI7pEsGEokkyw== X-Received: by 2002:a1c:688:: with SMTP id 130-v6mr13291398wmg.82.1529430004550; Tue, 19 Jun 2018 10:40:04 -0700 (PDT) Received: from venice.bhome (84-223-210-152.adsl-wholesale.clienti.tiscali.it. [84.223.210.152]) by smtp.gmail.com with ESMTPSA id i4-v6sm291776wrq.28.2018.06.19.10.40.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jun 2018 10:40:03 -0700 (PDT) From: Goffredo Baroncelli X-Google-Original-From: Goffredo Baroncelli To: grub-devel@gnu.org Subject: [PATCH V6] Add support for BTRFS raid5/6 to GRUB Date: Tue, 19 Jun 2018 19:39:47 +0200 Message-Id: <20180619173956.7356-1-kreijack@inwind.it> X-Mailer: git-send-email 2.18.0.rc2 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::242 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, 19 Jun 2018 17:40:10 -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 5 patches, are preparatory ones. The 7th patch implements the raid5 recovery for btrfs (i.e. handling the disappearing of 1 disk). The 8th patch makes the code for handling the raid6 recovery more generic. The last one implements the raid6 recovery for btrfs (i.e. handling the disappearing up to two disks). I tested the code in grub-emu, and it works both with all the disks, and with some disks missing. I checked the crc32 calculated from grub and from linux and these matched. Finally I checked if the support for md raid6 still works properly, and it does (with all drives and with up to 2 drives missing) Comments are welcome. Changelog v1: initial support for btrfs raid5/6. No recovery allowed v2: full support for btrfs raid5/6. Recovery allowed v3: some minor cleanup suggested by Daniel Kiper; reusing the original raid6 recovery code of grub v4: Several spell fix; better description of the RAID layout in btrfs, and the variables which describes 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 v6: Small cleanup; improved the wording in the RAID6 layout description; in the function raid6_recover_read_buffer() avoid a unnecessary memcpy in case of invalid data;