public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools: hv: fcopy_daemon: support >2GB files for x86_32 guest
@ 2015-03-05  3:30 Dexuan Cui
  0 siblings, 0 replies; only message in thread
From: Dexuan Cui @ 2015-03-05  3:30 UTC (permalink / raw)
  To: gregkh, linux-kernel, driverdev-devel, olaf, apw, jasowang, kys,
	vkuznets, alexng
  Cc: haiyangz

Without this patch, hv_fcopy_daemon's hv_copy_data() -> pwrite()
will fail for >2GB file offset.

Signed-off-by: Alex Ng <alexng@microsoft.com>
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Cc: K. Y. Srinivasan <kys@microsoft.com>
---

I tested the patch on x86_32 and x86_64 Ubuntu 15.04 nightly build(this is
a generic issue and I think all the existing x86_32 distros have the issue):
without the patch, the fcopy with a >2GB file always failed and with the patch
I was able to fcopy a file of 40GB successfully.

"getconf LFS_CFLAGS" returns "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
on x86_32 and returns an empty string on x86_64.

 tools/hv/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/hv/Makefile b/tools/hv/Makefile
index 99ffe61..a8ab795 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
-- 
1.9.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-03-05  2:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-05  3:30 [PATCH] tools: hv: fcopy_daemon: support >2GB files for x86_32 guest Dexuan Cui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox