Commit 00770a91 authored by Pavel Emelyanov's avatar Pavel Emelyanov

kerndat: Handle errors from devtmpfs virtualized checks

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 69bffe26
...@@ -745,16 +745,30 @@ out: ...@@ -745,16 +745,30 @@ out:
return ret; return ret;
} }
static bool rt_detmpfs_match(struct mount_info *pm) /*
* Virtualized devtmpfs on any side (dump or restore)
* means, that we should try to handle it as a plain
* tmpfs.
*
* Interesting case -- shared on dump and virtual on
* restore -- will fail, since no tarball with the fs
* contents will be found.
*/
static int devtmpfs_virtual(struct mount_info *pm)
{ {
return kerndat_fs_virtualized(KERNDAT_FS_STAT_DEVTMPFS, pm->s_dev) == 0; return kerndat_fs_virtualized(KERNDAT_FS_STAT_DEVTMPFS, pm->s_dev);
} }
static int devtmpfs_dump(struct mount_info *pm) static int devtmpfs_dump(struct mount_info *pm)
{ {
if (!rt_detmpfs_match(pm)) int ret;
return tmpfs_dump(pm);
return 0; ret = devtmpfs_virtual(pm);
if (ret == 1)
ret = tmpfs_dump(pm);
return ret;
} }
static int tmpfs_restore(struct mount_info *pm) static int tmpfs_restore(struct mount_info *pm)
...@@ -783,9 +797,13 @@ static int tmpfs_restore(struct mount_info *pm) ...@@ -783,9 +797,13 @@ static int tmpfs_restore(struct mount_info *pm)
static int devtmpfs_restore(struct mount_info *pm) static int devtmpfs_restore(struct mount_info *pm)
{ {
if (!rt_detmpfs_match(pm)) int ret;
return tmpfs_restore(pm);
return 0; ret = devtmpfs_virtual(pm);
if (ret == 1)
ret = tmpfs_restore(pm);
return ret;
} }
static int binfmt_misc_dump(struct mount_info *pm) static int binfmt_misc_dump(struct mount_info *pm)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment