xfs
[Top] [All Lists]

Re: mkfs.xfs on EVMS Volume forgot the releases used

To: Eric Sandeen <sandeen@xxxxxxx>
Subject: Re: mkfs.xfs on EVMS Volume forgot the releases used
From: Oliver Jehle <oliver.jehle@xxxxxxxx>
Date: 22 Mar 2002 07:01:22 +0100
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <Pine.LNX.4.33.0203210822060.19919-100000@xxxxxxxxxxxxxxxxxxxxxxxx>
References: <Pine.LNX.4.33.0203210822060.19919-100000@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: owner-linux-xfs@xxxxxxxxxxx
Got Answer from the evms team... 
hey fix the BLKGETSIZE64 problem !!


http://sourceforge.net/mailarchive/message.php?msg_id=1343124

thanks for helping

oliver



On Thu, 2002-03-21 at 15:29, Eric Sandeen wrote:
> On 21 Mar 2002, Oliver Jehle wrote:
> 
> > > ioctl(5, 0x80041272, 0xbfffe124)        = -1 EINVAL (Invalid argument)
> > > write(2, "mkfs.xfs: can\'t determine device"..., 38mkfs.xfs: can't
> > > determine device size
> > > ) = 38
> > > _exit(1)                                = ?
> 
> Ok, it looks like the BLKGETSIZE64 ioctl is failing.  The very latest
> mkfs.xfs will fall back to BLKGETSIZE if this happens; I guess we need to
> update what's on oss.
> 
> You should suggest to the evms folks that they implement BLKGETSIZE64, but
> in the meantime this patch will fix things for you:
> 
> --- /usr/tmp/TmpDir.30077-0/cmd/xfsprogs/libxfs/init.c_1.12   Thu Mar 21
> 08:28:40 2002
> +++ /usr/tmp/TmpDir.30077-0/cmd/xfsprogs/libxfs/init.c_1.13   Thu Mar 21
> 08:28:40 2002
> @@ -156,11 +156,19 @@
>               exit(1);
>       }
>       error = ioctl(fd, BLKGETSIZE64, &size);
> -     /* BLKGETSIZE64 returns size in bytes */
> -     size = size >> 9;
> -     if (error < 0) {
> -             fprintf(stderr, "%s: can't determine device size\n",
> progname);
> -             exit(1);
> +     if (error >= 0) {
> +             /* BLKGETSIZE64 returns size in bytes not 512-byte blocks
> */
> +             size = size >> 9;
> +     } else {
> +             /* If BLKGETSIZE64 fails, try BLKGETSIZE */
> +             unsigned long tmpsize;
> +             error = ioctl(fd, BLKGETSIZE, &tmpsize);
> +             if (error < 0) {
> +                     fprintf(stderr, "%s: can't determine device
> size\n",
> +                             progname);
> +                     exit(1);
> +             }
> +             size = (__uint64_t)tmpsize;
>       }
> 
>       close(fd);
> 
> 
> 
> -Eric
> 



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