mount-until: make sure we'll exit bind_remount_recursive_with_mountinfo() loop eventually
Just some robustness given that /proc/self/mountinfo was previously broken in the kernel.
This commit is contained in:
@@ -204,6 +204,7 @@ int bind_remount_recursive_with_mountinfo(
|
||||
|
||||
_cleanup_set_free_free_ Set *done = NULL;
|
||||
_cleanup_free_ char *simplified = NULL;
|
||||
unsigned n_tries = 0;
|
||||
int r;
|
||||
|
||||
assert(prefix);
|
||||
@@ -239,6 +240,9 @@ int bind_remount_recursive_with_mountinfo(
|
||||
char *x;
|
||||
unsigned long orig_flags;
|
||||
|
||||
if (n_tries++ >= 32) /* Let's not retry this loop forever */
|
||||
return -EBUSY;
|
||||
|
||||
todo = set_new(&path_hash_ops);
|
||||
if (!todo)
|
||||
return -ENOMEM;
|
||||
|
||||
Reference in New Issue
Block a user