The proposed change is already applied in Oracular and Plucky.

$ rmadison -a source cryptsetup
...
 cryptsetup | 2:2.7.2-2ubuntu1   | oracular       | source
 cryptsetup | 2:2.7.2-2ubuntu1   | plucky         | source

$ pull-lp-source cryptsetup
Found cryptsetup 2:2.7.2-2ubuntu1 in plucky

$ grep -A4 '^get_mnt_devno()' cryptsetup-2.7.2/debian/functions
get_mnt_devno() {
    local wantmount="$1" devnos="" uuid dev
    local out spec fstype DEV MAJ MIN

    # use awk rather than a `while read; do done` loop here as
/proc/mounts


** Description changed:

  [Impact]
  The shell's read builtin iterates through /proc/mounts one byte at a time. 
This becomes problematic when LDAP automount maps generate a large number of 
entries in /proc/mounts. It can lead to timeout issues, especially when 
iterating through the entries twice in the cryptroot hook.
  
  [Fix]
- Applying the following upstream commit can resolve this issue.
+ Applying the following upstream commit [1] can resolve this issue.
  
  95fd4be9b4c6 d/functions: get_mnt_devno(): Speed up execution time on large 
/proc/mounts.
-     Use awk rather than a `while read; do done` loop here as the /proc/mounts
-     pseudo-file can be many thousands lines long and the shell's `read` 
builtin
-     traverses it one read(2) at the time which cruelly slows down execution 
time.
+     Use awk rather than a `while read; do done` loop here as the /proc/mounts
+     pseudo-file can be many thousands lines long and the shell's `read` 
builtin
+     traverses it one read(2) at the time which cruelly slows down execution 
time.
  
-     See https://salsa.debian.org/cryptsetup-
+     See https://salsa.debian.org/cryptsetup-
  team/cryptsetup/-/merge_requests/36 .
+ 
+ [1] https://salsa.debian.org/cryptsetup-
+ team/cryptsetup/-/commit/95fd4be9b4c6471e94c418101e7acfae7e1aa4fc
  
  [Test Plan]
  Our primary objective is to ensure that the output remains consistent when 
obtaining devnos through iteration.
  1. Execute the /usr/share/initramfs-tools/hooks/cryptroot binary
  2. Confirm that the output does not include the following warning message:
  cryptsetup: WARNING: Couldn't determine root device
  
  [Where problems could occur]
  The patch exclusively modifies the method of extracting information without 
altering the underlying hook logic.
  It's crucial to note that the successful generation of the crypttab is 
contingent upon the accuracy of the information provided by the patch.
  Any inaccuracies may impede the crypttab generation process.

** Description changed:

  [Impact]
  The shell's read builtin iterates through /proc/mounts one byte at a time. 
This becomes problematic when LDAP automount maps generate a large number of 
entries in /proc/mounts. It can lead to timeout issues, especially when 
iterating through the entries twice in the cryptroot hook.
  
  [Fix]
  Applying the following upstream commit [1] can resolve this issue.
  
  95fd4be9b4c6 d/functions: get_mnt_devno(): Speed up execution time on large 
/proc/mounts.
      Use awk rather than a `while read; do done` loop here as the /proc/mounts
      pseudo-file can be many thousands lines long and the shell's `read` 
builtin
      traverses it one read(2) at the time which cruelly slows down execution 
time.
  
      See https://salsa.debian.org/cryptsetup-
  team/cryptsetup/-/merge_requests/36 .
  
  [1] https://salsa.debian.org/cryptsetup-
  team/cryptsetup/-/commit/95fd4be9b4c6471e94c418101e7acfae7e1aa4fc
  
  [Test Plan]
  Our primary objective is to ensure that the output remains consistent when 
obtaining devnos through iteration.
  1. Execute the /usr/share/initramfs-tools/hooks/cryptroot binary
  2. Confirm that the output does not include the following warning message:
  cryptsetup: WARNING: Couldn't determine root device
  
  [Where problems could occur]
  The patch exclusively modifies the method of extracting information without 
altering the underlying hook logic.
  It's crucial to note that the successful generation of the crypttab is 
contingent upon the accuracy of the information provided by the patch.
  Any inaccuracies may impede the crypttab generation process.
+ 
+ [Other Info]
+ The proposed change [1] is already applied in Oracular and Plucky.

** Also affects: cryptsetup (Ubuntu Oracular)
   Importance: Undecided
       Status: New

** Also affects: cryptsetup (Ubuntu Plucky)
   Importance: Undecided
     Assignee: Chengen Du (chengendu)
       Status: Incomplete

** Changed in: cryptsetup (Ubuntu Plucky)
       Status: Incomplete => Fix Released

** Changed in: cryptsetup (Ubuntu Oracular)
       Status: New => Fix Released

** Changed in: cryptsetup (Ubuntu Plucky)
     Assignee: Chengen Du (chengendu) => (unassigned)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2054390

Title:
  Refine proc mounts entries traversal

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/2054390/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to