Skip to contentSkip to conversation

pytest: Use --lazy with umount

PATCH In review Tom Rini 2 participants 7 messages Apr 6, 2023 – Apr 26, 2023

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 pytest: Use --lazy with umount

Sometimes when doing tests on real hardware we sometimes run in to the case where some of these mounts haven't been fully flushed. Using the --lazy option with umount will allow us to continue while letting the OS handle flushing the data out still.

---
 test/py/tests/test_ut.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
test/py/tests/test_ut.py +2 -2
index e8c8a6d6bd59..0b45863b4385 100644
@@ -213,7 +213,7 @@ booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}
               str(exc))
     finally:
         if mounted:
-            u_boot_utils.run_and_log(cons, 'sudo umount %s' % mnt)
+            u_boot_utils.run_and_log(cons, 'sudo umount --lazy %s' % mnt)
         if loop:
             u_boot_utils.run_and_log(cons, 'sudo losetup -d %s' % loop)
 
@@ -274,7 +274,7 @@ label Fedora-Workstation-armhfp-31-1.9 (5.3.7-301.fc31.armv7hl)
               str(exc))
     finally:
         if mounted:
-            u_boot_utils.run_and_log(cons, 'sudo umount %s' % mnt)
+            u_boot_utils.run_and_log(cons, 'sudo umount --lazy %s' % mnt)
         if loop:
             u_boot_utils.run_and_log(cons, 'sudo losetup -d %s' % loop)
 
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw

Hi Tom,

Quoted 10 lines · Tom Rini

Sometimes when doing tests on real hardware we sometimes run in to the case where some of these mounts haven't been fully flushed. Using the --lazy option with umount will allow us to continue while letting the OS handle flushing the data out still.

---
 test/py/tests/test_ut.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

I wonder if these ever actually succeed later on, or do they remain mounted forever?

Regards,
SImon

author
#2 lore raw
Quoted 14 lines · Simon Glass

Hi Tom,

Quoted 10 lines · Tom Rini

Sometimes when doing tests on real hardware we sometimes run in to the case where some of these mounts haven't been fully flushed. Using the --lazy option with umount will allow us to continue while letting the OS handle flushing the data out still.

---
 test/py/tests/test_ut.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 4 lines

I wonder if these ever actually succeed later on, or do they remain mounted forever?

They complete the unmount with this change done, yes.

Signature · 1 line
Tom
#3 lore raw

Hi Tom,

Quoted 16 lines · Tom Rini
Quoted 14 lines · Simon Glass

Hi Tom,

Quoted 10 lines · Tom Rini

Sometimes when doing tests on real hardware we sometimes run in to the case where some of these mounts haven't been fully flushed. Using the --lazy option with umount will allow us to continue while letting the OS handle flushing the data out still.

---
 test/py/tests/test_ut.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 6 lines
Quoted 4 lines

I wonder if these ever actually succeed later on, or do they remain mounted forever?

They complete the unmount with this change done, yes.

That's great to hear. I wonder if we should try a 'sync' beforehand? So long as it is short it shouldn't matter, but if it dragged on for a minute or two it might conflict with another job. I don't have a good understanding of what is going on in the kernel.

Regards,
Simon

author
#4 lore raw
Quoted 24 lines · Simon Glass

Hi Tom,

Quoted 21 lines · Tom Rini
Quoted 18 lines · Simon Glass

Hi Tom,

Quoted 10 lines · Tom Rini

Sometimes when doing tests on real hardware we sometimes run in to the case where some of these mounts haven't been fully flushed. Using the --lazy option with umount will allow us to continue while letting the OS handle flushing the data out still.

---
 test/py/tests/test_ut.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

I wonder if these ever actually succeed later on, or do they remain mounted forever?

Quoted 6 lines
Quoted 1 line

They complete the unmount with this change done, yes.

That's great to hear. I wonder if we should try a 'sync' beforehand? So long as it is short it shouldn't matter, but if it dragged on for a minute or two it might conflict with another job. I don't have a good understanding of what is going on in the kernel.

Based on a quick read of the man page, I think --lazy itself is just what we want here.

Signature · 1 line
Tom
#5 lore raw

Hi Tom,

Quoted 28 lines · Tom Rini
Quoted 26 lines · Simon Glass

Hi Tom,

Quoted 22 lines · Tom Rini
Quoted 14 lines · Simon Glass

Hi Tom,

Quoted 10 lines · Tom Rini

Sometimes when doing tests on real hardware we sometimes run in to the case where some of these mounts haven't been fully flushed. Using the --lazy option with umount will allow us to continue while letting the OS handle flushing the data out still.

---
 test/py/tests/test_ut.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 4 lines

I wonder if these ever actually succeed later on, or do they remain mounted forever?

They complete the unmount with this change done, yes.

Quoted 7 lines
Quoted 4 lines

That's great to hear. I wonder if we should try a 'sync' beforehand? So long as it is short it shouldn't matter, but if it dragged on for a minute or two it might conflict with another job. I don't have a good understanding of what is going on in the kernel.

Based on a quick read of the man page, I think --lazy itself is just what we want here.

OK good.

Regards,
Simon

author
#6 lore raw
In reply to Tom Rini
Quoted 7 lines · Tom Rini

Sometimes when doing tests on real hardware we sometimes run in to the case where some of these mounts haven't been fully flushed. Using the --lazy option with umount will allow us to continue while letting the OS handle flushing the data out still.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom