Commit 69721190 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

tmpfs: use device number instead of mnt_id in image names

One file system can be mounted a few times, so mnt_id isn't unique for it.
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 061d6cfa
...@@ -66,6 +66,7 @@ struct cr_fd_desc_tmpl fdset_template[CR_FD_MAX] = { ...@@ -66,6 +66,7 @@ struct cr_fd_desc_tmpl fdset_template[CR_FD_MAX] = {
FD_ENTRY(ROUTE, "route-%d"), FD_ENTRY(ROUTE, "route-%d"),
FD_ENTRY(IPTABLES, "iptables-%d"), FD_ENTRY(IPTABLES, "iptables-%d"),
FD_ENTRY(TMPFS_IMG, "tmpfs-%d.tar.gz"), FD_ENTRY(TMPFS_IMG, "tmpfs-%d.tar.gz"),
FD_ENTRY(TMPFS_DEV, "tmpfs-dev-%d.tar.gz"),
FD_ENTRY(TTY_FILES, "tty"), FD_ENTRY(TTY_FILES, "tty"),
FD_ENTRY(TTY_INFO, "tty-info"), FD_ENTRY(TTY_INFO, "tty-info"),
FD_ENTRY(FILE_LOCKS, "filelocks-%d"), FD_ENTRY(FILE_LOCKS, "filelocks-%d"),
......
...@@ -78,6 +78,7 @@ enum { ...@@ -78,6 +78,7 @@ enum {
_CR_FD_GLOB_TO, _CR_FD_GLOB_TO,
CR_FD_TMPFS_IMG, CR_FD_TMPFS_IMG,
CR_FD_TMPFS_DEV,
CR_FD_PAGES, CR_FD_PAGES,
CR_FD_PSIGNAL, CR_FD_PSIGNAL,
......
...@@ -77,6 +77,7 @@ ...@@ -77,6 +77,7 @@
#define IFADDR_MAGIC RAW_IMAGE_MAGIC #define IFADDR_MAGIC RAW_IMAGE_MAGIC
#define ROUTE_MAGIC RAW_IMAGE_MAGIC #define ROUTE_MAGIC RAW_IMAGE_MAGIC
#define TMPFS_IMG_MAGIC RAW_IMAGE_MAGIC #define TMPFS_IMG_MAGIC RAW_IMAGE_MAGIC
#define TMPFS_DEV_MAGIC RAW_IMAGE_MAGIC
#define IPTABLES_MAGIC RAW_IMAGE_MAGIC #define IPTABLES_MAGIC RAW_IMAGE_MAGIC
#define PAGES_OLD_MAGIC PAGEMAP_MAGIC #define PAGES_OLD_MAGIC PAGEMAP_MAGIC
......
...@@ -715,7 +715,7 @@ static int tmpfs_dump(struct mount_info *pm) ...@@ -715,7 +715,7 @@ static int tmpfs_dump(struct mount_info *pm)
goto out; goto out;
} }
fd_img = open_image(CR_FD_TMPFS_IMG, O_DUMP, pm->mnt_id); fd_img = open_image(CR_FD_TMPFS_DEV, O_DUMP, pm->s_dev);
if (fd_img < 0) if (fd_img < 0)
goto out; goto out;
...@@ -745,7 +745,9 @@ static int tmpfs_restore(struct mount_info *pm) ...@@ -745,7 +745,9 @@ static int tmpfs_restore(struct mount_info *pm)
int ret; int ret;
int fd_img; int fd_img;
fd_img = open_image(CR_FD_TMPFS_IMG, O_RSTR, pm->mnt_id); fd_img = open_image(CR_FD_TMPFS_DEV, O_RSTR, pm->s_dev);
if (fd_img < 0 && errno == ENOENT)
fd_img = open_image(CR_FD_TMPFS_IMG, O_RSTR, pm->mnt_id);
if (fd_img < 0) if (fd_img < 0)
return -1; return -1;
......
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