Skip to content

Commit

Permalink
utils: handle > 2^31 in lxc_unstack_mountpoint()
Browse files Browse the repository at this point in the history
I mean.. really? But better safe than sorry.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner authored and stgraber committed May 10, 2017
1 parent 75022b5 commit a8b012a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lxc/utils.c
Expand Up @@ -2221,10 +2221,15 @@ int lxc_unstack_mountpoint(const char *path, bool lazy)
if (errno != EINVAL)
return -errno;
} else {
/* Just stop counting when this happens. That'd just be so
* stupid that we won't even bother trying to report back the
* correct value anymore.
*/
if (umounts != INT_MAX)
umounts++;
/* We succeeded in umounting. Make sure that there's no other
* mountpoint stacked underneath.
*/
umounts++;
goto pop_stack;
}

Expand Down

0 comments on commit a8b012a

Please sign in to comment.