criu: don't interrupt do_new_mount() after appling mount options

Submitted by Andrei Vagin on May 24, 2016, 8:20 p.m.

Details

Message ID 1464121243-3791-1-git-send-email-avagin@openvz.org
State Accepted
Series "criu: don't interrupt do_new_mount() after appling mount options"
Commit a42f2b96749fbbdf2350075357e59ce3e1b8d986
Headers show

Commit Message

Andrei Vagin May 24, 2016, 8:20 p.m.
From: Andrew Vagin <avagin@virtuozzo.com>

Reported-by: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
Cc: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
---
 criu/mount.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/mount.c b/criu/mount.c
index 4b0c553..d4e8e45 100644
--- a/criu/mount.c
+++ b/criu/mount.c
@@ -2402,9 +2402,11 @@  static int do_new_mount(struct mount_info *mi)
 	if (tp->restore && tp->restore(mi))
 		return -1;
 
-	if (remount_ro)
-		return mount(NULL, mi->mountpoint, tp->name,
-			     MS_REMOUNT | MS_RDONLY, NULL);
+	if (remount_ro && mount(NULL, mi->mountpoint, tp->name,
+				     MS_REMOUNT | MS_RDONLY, NULL)) {
+		pr_perror("Unable to apply mount options");
+		return -1;
+	}
 
 	if (mflags && mount(NULL, mi->mountpoint, NULL,
 				MS_REMOUNT | MS_BIND | mflags, NULL)) {

Comments

Pavel Emelianov May 27, 2016, 7:04 p.m.
Applied