From: Christoph Hellwig Date: Tue, 19 Apr 2005 07:33:02 +0000 (+0000) Subject: fix obj_to_handle on 64bit, Big Endian Systems X-Git-Tag: v2.7.0~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ace4c158884a3aeb3c1b88910ec585eb1ded5678;p=thirdparty%2Fxfsprogs-dev.git fix obj_to_handle on 64bit, Big Endian Systems bump to 2.6.29 --- diff --git a/VERSION b/VERSION index 34f2296fe..a0373dc1d 100644 --- a/VERSION +++ b/VERSION @@ -3,5 +3,5 @@ # PKG_MAJOR=2 PKG_MINOR=6 -PKG_REVISION=28 +PKG_REVISION=29 PKG_BUILD=1 diff --git a/doc/CHANGES b/doc/CHANGES index 6099216c3..815b086f8 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -1,3 +1,7 @@ +xfsprogs-2.6.29 (19 April 2005) + - Fix mkfs.xfs -dfile. + - Fix libhandle on 64bit, Big Endian systems. + xfsprogs-2.6.28 (30 March 2005) - Fix compiler warning in repair/dir.c size checks. - Fix more compilation problem with version 4 of gcc diff --git a/libhandle/handle.c b/libhandle/handle.c index 749a45fc3..988f36dab 100644 --- a/libhandle/handle.c +++ b/libhandle/handle.c @@ -191,6 +191,7 @@ obj_to_handle( { char hbuf [MAXHANSIZ]; int ret; + __uint32_t handlen; xfs_fsop_handlereq_t hreq; if (opcode == XFS_IOC_FD_TO_HANDLE) { @@ -205,24 +206,20 @@ obj_to_handle( hreq.ihandle = NULL; hreq.ihandlen = 0; hreq.ohandle = hbuf; - hreq.ohandlen = (__u32 *)hlen; - - /* the xfsctl call will only modify the low 32 bits of *hlen, - * but *hlen (size_t) could be a 64 bit value on some systems. - * zero it out beforehand in case any upper bits are set. */ - *hlen = 0; + hreq.ohandlen = &handlen; ret = xfsctl(fspath, fsfd, opcode, &hreq); if (ret) return ret; - *hanp = malloc(*hlen); + *hanp = malloc(handlen); if (*hanp == NULL) { errno = ENOMEM; return -1; } - memcpy(*hanp, hbuf, (int) *hlen); + memcpy(*hanp, hbuf, handlen); + *hlen = handlen; return 0; }