xfs
[Top] [All Lists]

Re: XFS (CVS release) problem: mkfs.xfs failed on hppa

To: "Nathan Scott" <nathans@xxxxxxx>
Subject: Re: XFS (CVS release) problem: mkfs.xfs failed on hppa
From: jsoe0708@xxxxxxxxxx
Date: Fri, 25 Oct 2002 15:10:56 +0200
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <20021025015459.GD687@frodo>
Sender: linux-xfs-bounce@xxxxxxxxxxx
Hi Nathan,

>This ioctl is called from in cmd/xfsprogs/libxfs/init.c::findsize
>so that's probably a good place to start debugging.
>

This was the right place.
ANy way I prety sure that I found a small bug at this place.

Here is my full patch:
--- cmd/xfsprogs/libxfs/init.c.orig     2002-10-25 12:12:29.000000000 +0200
+++ cmd/xfsprogs/libxfs/init.c  2002-10-25 14:22:34.000000000 +0200
@@ -155,11 +155,14 @@
                        progname, path, strerror(errno));
                exit(1);
        }
+#if !defined(__hppa__) || defined(__LP64__)
        error = ioctl(fd, BLKGETSIZE64, &size);
-       if (error >= 0) {
+       if (!error) {
                /* BLKGETSIZE64 returns size in bytes not 512-byte blocks */
                size = size >> 9;
-       } else {
+       } else
+#endif
+        {
                /* If BLKGETSIZE64 fails, try BLKGETSIZE */
                unsigned long tmpsize;
                error = ioctl(fd, BLKGETSIZE, &tmpsize);

AFAIK ioctl return error = 0 if success and error >0 if fault. So at least
lines 6 and 7 should be applied?

Thanks again for relevant advise,
    Joel


<Prev in Thread] Current Thread [Next in Thread>