[CRIU] [PATCH] cr-dump: discover fs type in fill_fd_params_special
Stanislav Kinsburskiy
skinsbursky at virtuozzo.com
Thu Jun 30 09:49:17 PDT 2016
FS type is required to distinguish between local files and remove ones, which
will be restored via SPFS and thus has to be created first.
Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
---
criu/cr-dump.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/criu/cr-dump.c b/criu/cr-dump.c
index ffa57d5..64fa99e 100644
--- a/criu/cr-dump.c
+++ b/criu/cr-dump.c
@@ -229,6 +229,8 @@ static int collect_fds(pid_t pid, struct parasite_drain_fd **dfds)
static int fill_fd_params_special(int fd, struct fd_parms *p)
{
+ struct statfs fst;
+
*p = FD_PARMS_INIT;
if (fstat(fd, &p->stat) < 0) {
@@ -239,6 +241,13 @@ static int fill_fd_params_special(int fd, struct fd_parms *p)
if (get_fd_mntid(fd, &p->mnt_id))
return -1;
+ if (fstatfs(fd, &fst)) {
+ pr_perror("Unable to statfs fd %d", fd);
+ return -1;
+ }
+
+ p->fs_type = fst.f_type;
+
return 0;
}
More information about the CRIU
mailing list