liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

0001-Prepare-for-1.2.0.2-attempt-ro-remount-if-umount-fai.patch (1170B)


      1 From 7329cd1b23ba51c9ea8f526dbd491b8cd9d5b822 Mon Sep 17 00:00:00 2001
      2 From: Laurent Bercot <ska-skaware@skarnet.org>
      3 Date: Sat, 23 May 2026 12:30:44 +0000
      4 Subject: [PATCH]  Prepare for 1.2.0.2; attempt ro remount if umount fails
      5 
      6 ---
      7  src/misc/s6-linux-init-umountall.c | 15 +++++++++++++--
      8  1 file changed, 13 insertions(+), 2 deletions(-)
      9 
     10 diff --git a/src/misc/s6-linux-init-umountall.c b/src/misc/s6-linux-init-umountall.c
     11 index d4320ad..e7a2f53 100644
     12 --- a/src/misc/s6-linux-init-umountall.c
     13 +++ b/src/misc/s6-linux-init-umountall.c
     14 @@ -55,8 +55,19 @@ int main (int argc, char const *const *argv)
     15    while (line--)
     16      if (umount(sa.s + mountpoints[line]) == -1)
     17      {
     18 -      e++ ;
     19 -      strerr_warnwu2sys("umount ", sa.s + mountpoints[line]) ;
     20 +      if (errno == EBUSY)
     21 +      {
     22 +        if (mount(0, sa.s + mountpoints[line], 0, MS_REMOUNT | MS_RDONLY, 0) == -1)
     23 +        {
     24 +          e++ ;
     25 +          strerr_warnwusys("read-only remount ", sa.s + mountpoints[line]) ;
     26 +        }
     27 +      }
     28 +      else
     29 +      {
     30 +        e++ ;
     31 +        strerr_warnwu2sys("umount ", sa.s + mountpoints[line]) ;
     32 +      }
     33      }
     34    stralloc_free(&sa) ;
     35    return e ;
     36 -- 
     37 2.54.0
     38