Explorar el Código

fix(susfs-patches): replace buggy task_mmu.c fake patch for 6.6 <=30

The old sed+perl combo appended a duplicate 'last_vma_end = vma->vm_end;'
line, then the perl matched the wrong copy at the wrong nesting level,
producing broken code that hunk #6 of 50_add_susfs_in_gki-android15-6.6.patch
couldn't land on. Replaced with a single regex that cleanly adds braces
around the if-body in the contention-recovery path.
TheWildJames hace 1 mes
padre
commit
d009887950
Se han modificado 1 ficheros con 9 adiciones y 18 borrados
  1. 9 18
      .github/actions/susfs-patches/action.yml

+ 9 - 18
.github/actions/susfs-patches/action.yml

@@ -103,26 +103,17 @@ runs:
         echo "Applying 6.6 SUSFS fixes"
         if [ "${{ inputs.sublevel }}" -le "30" ]; then
           echo "Applying taskmmu.c Android 15 6.6 Fake Patch"
-          sed -i '/smap_gather_stats(vma, &mss, last_vma_end);/a\last_vma_end = vma->vm_end;' fs/proc/task_mmu.c
           perl -0777 -i -pe '
-          @l = split /\n/;
-          for ($i = $#l; $i >= 0; $i--) {
-              if ($l[$i] =~ /last_vma_end = vma->vm_end;/) {
-                  $l[$i] = "\t\t\t\t" . $l[$i];
-                  splice(@l, $i + 1, 0, "\t\t\t}");
-
-                  # add { to the if line above
-                  for ($j = $i; $j >= 0; $j--) {
-                      if ($l[$j] =~ /if\s*\(vma->vm_end > last_vma_end\)/) {
-                          $l[$j] =~ s/\)\s*\$/) {/;
-                          last;
-                      }
-                  }
-
-                  last;
-              }
+          s{
+            (\t+\t\tif\s*\(\s*vma->vm_end\s*>\s*last_vma_end\s*\))
+            (
+              \n\t+\t\t\tsmap_gather_stats\(vma,\s*&mss,\s*last_vma_end\);
+              \n\t+\t\t\tlast_vma_end\s*=\s*vma->vm_end;
+            )
           }
-          $_ = join "\n", @l
+          {
+            $1 . " {" . $2 . "\n\t\t\t}"
+          }ex
           ' fs/proc/task_mmu.c
         fi
         if [ "${{ inputs.sublevel }}" -le "92" ]; then