From b4affbbb7217e440f80c922b2b304795758d40bb Mon Sep 17 00:00:00 2001 From: Dexuan Cui Date: Wed, 18 Mar 2015 12:29:26 -0700 Subject: tools: hv: fcopy_daemon: support >2GB files for x86_32 guest Without this patch, hv_fcopy_daemon's hv_copy_data() -> pwrite() will fail for >2GB file offset. The current char-next branch is broken and this patch fixes the bug. Signed-off-by: Alex Ng Signed-off-by: Dexuan Cui Cc: K. Y. Srinivasan Signed-off-by: K. Y. Srinivasan Signed-off-by: Greg Kroah-Hartman --- tools/hv/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/hv/Makefile b/tools/hv/Makefile index 99ffe61051a7..a8ab79556926 100644 --- a/tools/hv/Makefile +++ b/tools/hv/Makefile @@ -3,7 +3,7 @@ CC = $(CROSS_COMPILE)gcc PTHREAD_LIBS = -lpthread WARNINGS = -Wall -Wextra -CFLAGS = $(WARNINGS) -g $(PTHREAD_LIBS) +CFLAGS = $(WARNINGS) -g $(PTHREAD_LIBS) $(shell getconf LFS_CFLAGS) all: hv_kvp_daemon hv_vss_daemon hv_fcopy_daemon %: %.c -- cgit v1.2.3 From 4ce50e9491c5c92baf8bb7af85eb25398d3f70af Mon Sep 17 00:00:00 2001 From: Vaughan Cao Date: Wed, 18 Mar 2015 12:29:28 -0700 Subject: hv: hypervvssd: call endmntent before call setmntent again If freeze fails, vss_operate will re-enter itself to thaw. But it forgets to call endmntent() before it recalls setmntent() again. Signed-off-by: Vaughan Cao Signed-off-by: K. Y. Srinivasan Signed-off-by: Greg Kroah-Hartman --- tools/hv/hv_vss_daemon.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/hv/hv_vss_daemon.c b/tools/hv/hv_vss_daemon.c index 5e63f70bd956..506dd0148828 100644 --- a/tools/hv/hv_vss_daemon.c +++ b/tools/hv/hv_vss_daemon.c @@ -81,6 +81,7 @@ static int vss_operate(int operation) char match[] = "/dev/"; FILE *mounts; struct mntent *ent; + char errdir[1024] = {0}; unsigned int cmd; int error = 0, root_seen = 0, save_errno = 0; @@ -115,6 +116,8 @@ static int vss_operate(int operation) goto err; } + endmntent(mounts); + if (root_seen) { error |= vss_do_freeze("/", cmd); if (error && operation == VSS_OP_FREEZE) @@ -124,16 +127,19 @@ static int vss_operate(int operation) goto out; err: save_errno = errno; + if (ent) { + strncpy(errdir, ent->mnt_dir, sizeof(errdir)-1); + endmntent(mounts); + } vss_operate(VSS_OP_THAW); /* Call syslog after we thaw all filesystems */ if (ent) syslog(LOG_ERR, "FREEZE of %s failed; error:%d %s", - ent->mnt_dir, save_errno, strerror(save_errno)); + errdir, save_errno, strerror(save_errno)); else syslog(LOG_ERR, "FREEZE of / failed; error:%d %s", save_errno, strerror(save_errno)); out: - endmntent(mounts); return error; } -- cgit v1.2.3