]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
find-esp: fix XBOOTLDR stx_dev_major=0 and not btrfs fix
authorнаб <nabijaczleweli@nabijaczleweli.xyz>
Thu, 15 Jun 2023 13:04:32 +0000 (15:04 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 16 Jun 2023 00:20:52 +0000 (01:20 +0100)
The original commit is fully correct in its analysis, description, and
mechanics, but the patch changes an identical condition around line 500
(find_esp_and_warn()), instead of line 800 (find_xbootldr_and_warn()).

The internal patch I distributed to testers was correct (L800), and
neither the reviewers, nor me, caught that I wrote the wrong line for
upstream submission. I've re-checked that this patch applied to
systemd 252.11-1 fixes the issue.

Keep the -ENOTTY condition for find_esp_and_warn(), since the conditions
are clearly supposed to be the same and similar semantics apply.

Fixes: commit ed89819f8fd7bfe99cd652082076e85e1417e4e9 ("find-esp: don't
 silently error bootctl install if presumed XBOOTLDR part is
 stx_dev_major=0 but not btrfs")

src/shared/find-esp.c

index d9336f4431d05bf7286f96e27f3a931b7bc0b392..6b460a27cb9c0d1c56f43df1953cb92e96caf791 100644 (file)
@@ -840,7 +840,7 @@ int find_xbootldr_and_warn_at(
 
         r = verify_xbootldr(rfd, "/boot", flags | VERIFY_ESP_SEARCHING, ret_path, ret_uuid, ret_devid);
         if (r < 0) {
-                if (!IN_SET(r, -ENOENT, -EADDRNOTAVAIL, -ENOTDIR)) /* This one is not it */
+                if (!IN_SET(r, -ENOENT, -EADDRNOTAVAIL, -ENOTDIR, -ENOTTY)) /* This one is not it */
                         return r;
 
                 return -ENOKEY;