[LTP] [PATCH v6 1/2] safe_macros: Use tst_umount() in safe_umount()

Cyril Hrubis chrubis@suse.cz
Fri Feb 7 16:57:30 CET 2020


Hi!
> > My expectation is that retrying on EBUSY will not break anything. Jan
> > what do you think?
> 
> I agree. Though I'd like to point out that tst_umount() currently loops
> on any error, not just EBUSY.

Right, I guess that we should change that to be on the safe side, it was
never intended to retry anything else than EBUSY.

What about?

diff --git a/lib/tst_device.c b/lib/tst_device.c
index 89b9c96de..52a5b37fd 100644
--- a/lib/tst_device.c
+++ b/lib/tst_device.c
@@ -371,6 +371,9 @@ int tst_umount(const char *path)
                                 "mounted fs, kill it to speed up tests.");
                }
 
+               if (err != EBUSY) {
+                       errno = err;
+                       return ret;
+               }
+
                usleep(100000);
        }


-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list