[lxc-devel] [lxc/master] conf: flatten logic in mount_entry()

brauner on Github lxc-bot at linuxcontainers.org
Thu Mar 19 13:00:43 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 364 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200319/5179d965/attachment.bin>
-------------- next part --------------
From 15f3e22b00e3b25b1cf5ae031681277d46a040cd Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Thu, 19 Mar 2020 13:27:51 +0100
Subject: [PATCH] conf: flatten logic in mount_entry()

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 src/lxc/conf.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index 5c280c3815..066a600d66 100644
--- a/src/lxc/conf.c
+++ b/src/lxc/conf.c
@@ -1875,11 +1875,9 @@ static int mount_entry(const char *fsname, const char *target,
 			 * does not have any flags which are not already in
 			 * mountflags, then skip the remount.
 			 */
-			if (!(mountflags & MS_REMOUNT)) {
-				if (!(required_flags & ~mountflags)) {
-					DEBUG("Mountflags already were %lu, skipping remount", mountflags);
-					goto skipremount;
-				}
+			if (!(mountflags & MS_REMOUNT) && !(required_flags & ~mountflags)) {
+				DEBUG("Mountflags already were %lu, skipping remount", mountflags);
+				goto skipremount;
 			}
 
 			mountflags |= required_flags;


More information about the lxc-devel mailing list