mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-03 15:55:53 +00:00
mount: strip options for all mounts
Currently we stript options only one of brothers, but mount_equal() thinks that two brothers should have the same options. Execute zdtm/live/static/mountpoints ./mountpoints --pidfile=mountpoints.pid --outfile=mountpoints.out Dump 2737 WARNING: mountpoints returned 1 and left running for debug needs Test: zdtm/live/static/mountpoints, Result: FAIL ==================================== ERROR ==================================== Test: zdtm/live/static/mountpoints, Namespace: Dump log : /root/git/criu/test/dump/static/mountpoints/2737/1/dump.log --------------------------------- grep Error --------------------------------- (00.146444) Error (mount.c:399): Two shared mounts 50, 67 have different sets of children (00.146460) Error (mount.c:402): 67:./zdtm_mpts/dev/share-1 doesn't have a proper point for 54:./zdtm_mpts/dev/share-3/test.mnt.share (00.146820) Error (cr-dump.c:1921): Dumping FAILED. ------------------------------------- END ------------------------------------- ================================= ERROR OVER ================================= Reported-by: Ruslan Kuprieiev <kupruser@gmail.com> Signed-off-by: Andrey Vagin <avagin@openvz.org> Tested-by: Ruslan Kuprieiev <kupruser@gmail.com> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
cb738520e3
commit
f88d72d0bd
15
mount.c
15
mount.c
@@ -901,19 +901,6 @@ uns:
|
|||||||
return &fstypes[0];
|
return &fstypes[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *strip(char *opt)
|
|
||||||
{
|
|
||||||
int len;
|
|
||||||
|
|
||||||
len = strlen(opt);
|
|
||||||
if (len > 1 && opt[len - 1] == ',')
|
|
||||||
opt[len - 1] = '\0';
|
|
||||||
if (opt[0] == ',')
|
|
||||||
opt++;
|
|
||||||
|
|
||||||
return opt;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int dump_one_mountpoint(struct mount_info *pm, int fd)
|
static int dump_one_mountpoint(struct mount_info *pm, int fd)
|
||||||
{
|
{
|
||||||
MntEntry me = MNT_ENTRY__INIT;
|
MntEntry me = MNT_ENTRY__INIT;
|
||||||
@@ -940,7 +927,7 @@ static int dump_one_mountpoint(struct mount_info *pm, int fd)
|
|||||||
me.flags = pm->flags;
|
me.flags = pm->flags;
|
||||||
me.mountpoint = pm->mountpoint + 1;
|
me.mountpoint = pm->mountpoint + 1;
|
||||||
me.source = pm->source;
|
me.source = pm->source;
|
||||||
me.options = strip(pm->options);
|
me.options = pm->options;
|
||||||
me.shared_id = pm->shared_id;
|
me.shared_id = pm->shared_id;
|
||||||
me.has_shared_id = true;
|
me.has_shared_id = true;
|
||||||
me.master_id = pm->master_id;
|
me.master_id = pm->master_id;
|
||||||
|
13
proc_parse.c
13
proc_parse.c
@@ -797,6 +797,7 @@ static int do_opt2flag(char *opt, unsigned *flags,
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char *end;
|
char *end;
|
||||||
|
size_t uoff = 0;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
end = strchr(opt, ',');
|
end = strchr(opt, ',');
|
||||||
@@ -815,15 +816,17 @@ static int do_opt2flag(char *opt, unsigned *flags,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(unknown, opt);
|
strcpy(unknown + uoff, opt);
|
||||||
unknown += strlen(opt);
|
uoff += strlen(opt);
|
||||||
*unknown = ',';
|
unknown[uoff] = ',';
|
||||||
unknown++;
|
uoff++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!end) {
|
if (!end) {
|
||||||
|
if (uoff)
|
||||||
|
uoff--;
|
||||||
if (unknown)
|
if (unknown)
|
||||||
*unknown = '\0';
|
unknown[uoff] = '\0';
|
||||||
break;
|
break;
|
||||||
} else
|
} else
|
||||||
opt = end + 1;
|
opt = end + 1;
|
||||||
|
Reference in New Issue
Block a user