public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] isar-events: Fix processing of /proc/mounts
@ 2018-12-09 16:06 Jan Kiszka
  2018-12-11  8:12 ` Maxim Yu. Osipov
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2018-12-09 16:06 UTC (permalink / raw)
  To: isar-users

From: Jan Kiszka <jan.kiszka@siemens.com>

We have to read /proc/mounts completely before starting to umount. That
virtual file will change after each umount, and that could make us miss
some mount points.

Fixes: 05d0fc43e9e9 ("isar-events: Improve umount handler")
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta/classes/isar-events.bbclass | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/meta/classes/isar-events.bbclass b/meta/classes/isar-events.bbclass
index 05b27e5..c4a6149 100644
--- a/meta/classes/isar-events.bbclass
+++ b/meta/classes/isar-events.bbclass
@@ -18,10 +18,11 @@ python isar_handler() {
 
     with open(os.devnull, 'w') as devnull:
         with open('/proc/mounts', 'rU') as f:
-            for line in f:
-                if basepath in line:
-                    subprocess.call('sudo umount -l ' + line.split()[1],
-                                    stdout=devnull, stderr=devnull, shell=True)
+            lines = f.readlines()
+        for line in lines:
+            if basepath in line:
+                subprocess.call('sudo umount -l ' + line.split()[1],
+                                stdout=devnull, stderr=devnull, shell=True)
 }
 
 isar_handler[eventmask] = "bb.runqueue.runQueueExitWait bb.event.BuildCompleted"
-- 
2.16.4

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] isar-events: Fix processing of /proc/mounts
  2018-12-09 16:06 [PATCH] isar-events: Fix processing of /proc/mounts Jan Kiszka
@ 2018-12-11  8:12 ` Maxim Yu. Osipov
  0 siblings, 0 replies; 2+ messages in thread
From: Maxim Yu. Osipov @ 2018-12-11  8:12 UTC (permalink / raw)
  To: Jan Kiszka, isar-users

On 12/9/18 7:06 PM, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> We have to read /proc/mounts completely before starting to umount. That
> virtual file will change after each umount, and that could make us miss
> some mount points.

Applied to the 'next',

Thanks,
Maxim.

> Fixes: 05d0fc43e9e9 ("isar-events: Improve umount handler")
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>   meta/classes/isar-events.bbclass | 9 +++++----
>   1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/meta/classes/isar-events.bbclass b/meta/classes/isar-events.bbclass
> index 05b27e5..c4a6149 100644
> --- a/meta/classes/isar-events.bbclass
> +++ b/meta/classes/isar-events.bbclass
> @@ -18,10 +18,11 @@ python isar_handler() {
>   
>       with open(os.devnull, 'w') as devnull:
>           with open('/proc/mounts', 'rU') as f:
> -            for line in f:
> -                if basepath in line:
> -                    subprocess.call('sudo umount -l ' + line.split()[1],
> -                                    stdout=devnull, stderr=devnull, shell=True)
> +            lines = f.readlines()
> +        for line in lines:
> +            if basepath in line:
> +                subprocess.call('sudo umount -l ' + line.split()[1],
> +                                stdout=devnull, stderr=devnull, shell=True)
>   }
>   
>   isar_handler[eventmask] = "bb.runqueue.runQueueExitWait bb.event.BuildCompleted"
> 


-- 
Maxim Osipov
ilbers GmbH
Maria-Merian-Str. 8
85521 Ottobrunn
Germany
+49 (151) 6517 6917
mosipov@ilbers.de
http://ilbers.de/
Commercial register Munich, HRB 214197
General Manager: Baurzhan Ismagulov

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-12-11  8:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-09 16:06 [PATCH] isar-events: Fix processing of /proc/mounts Jan Kiszka
2018-12-11  8:12 ` Maxim Yu. Osipov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox