Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* sys_lseek() broken for alpha
@ 1996-05-13 15:35 Harald Koenig
  1996-05-14  0:11 ` Stephen C. Tweedie
  0 siblings, 1 reply; 5+ messages in thread
From: Harald Koenig @ 1996-05-13 15:35 UTC (permalink / raw)


Hi,

sys_lseek() should return off_t which is long (64 bit) for alpha but
returns 32bit int.  as a result, fdisk fails for >2GB disks.
from "strace fdisk" on alpha:

-------------------------------------------------------------------------------
lseek(4, 1720535040, SEEK_SET)          = 1720535040
read(4, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 512) = 512
lseek(4, 2580802560, SEEK_SET)          = -1 E??? (errno 1714164736)
write(2, "\n", 1)                       = 1
write(2, "Unable to seek on /dev/sdc\n", 27) = 27
-------------------------------------------------------------------------------

this fixes the fdisk problems with lseek above 2GB:

-------------------------------------------------------------------------------
--- linux/fs/read_write.c~	Mon May 13 14:55:27 1996
+++ linux/fs/read_write.c	Mon May 13 14:55:38 1996
@@ -15,7 +15,7 @@
 
 #include <asm/segment.h>
 
-asmlinkage int sys_lseek(unsigned int fd, off_t offset, unsigned int origin)
+asmlinkage off_t sys_lseek(unsigned int fd, off_t offset, unsigned int origin)
 {
 	struct file * file;
 	long tmp = -1;
-------------------------------------------------------------------------------

Harald

-- 
All SCSI disks will from now on                     ___       _____
be required to send an email notice                0--,|    /OOOOOOO\
24 hours prior to complete hardware failure!      <_/  /  /OOOOOOOOOOO\
                                                    \  \/OOOOOOOOOOOOOOO\
                                                      \ OOOOOOOOOOOOOOOOO|//
Harald Koenig,                                         \/\/\/\/\/\/\/\/\/
Inst.f.Theoret.Astrophysik                              //  /     \\  \
koenig@tat.physik.uni-tuebingen.de                     ^^^^^       ^^^^^

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: sys_lseek() broken for alpha
  1996-05-13 15:35 Harald Koenig
@ 1996-05-14  0:11 ` Stephen C. Tweedie
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen C. Tweedie @ 1996-05-14  0:11 UTC (permalink / raw)


Hi,

On Mon, 13 May 1996 17:35:32 +0200 (MET DST),
koenig@tat.physik.uni-tuebingen.de (Harald Koenig) said:

> sys_lseek() should return off_t which is long (64 bit) for alpha but
> returns 32bit int.  as a result, fdisk fails for >2GB disks.

Go and complain to your friendly ANSI / K&R / POSIX guru. :(  I'm
afraid that the return type NEEDS to be int for compliance with the
world's libc standards.  That's precisely why we need sys_llseek() on
the intel platform to get 64-bit partition access.

Cheers,
 Stephen.

--
Stephen Tweedie <sct@dcs.ed.ac.uk>
Department of Computer Science, Edinburgh University, Scotland.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: sys_lseek() broken for alpha
       [not found] <199605140011.BAA00734@dax.dcs.ed.ac.uk>
@ 1996-05-14  9:38 ` Harald Koenig
  1996-05-14 21:08 ` Chris Griffin
  1 sibling, 0 replies; 5+ messages in thread
From: Harald Koenig @ 1996-05-14  9:38 UTC (permalink / raw)


> > sys_lseek() should return off_t which is long (64 bit) for alpha but
> > returns 32bit int.  as a result, fdisk fails for >2GB disks.
> 
> Go and complain to your friendly ANSI / K&R / POSIX guru. :(  I'm
> afraid that the return type NEEDS to be int for compliance with the
> world's libc standards.  

I don't have any POSIX docs and ANSI-C (1989) says nothing about lseek().
K&R 2nd edition page 175 top even says:

	long lseek(int fd, long offset, int origin);

and DEC Unix unistd.h and sys/types.h say

	extern off_t lseek __((int , off_t , int ));
	typedef long    off_t;                  /* file offset */

also the libc-linux man page and include files mention

       off_t lseek(int fildes, off_t offset, int whence);

so I'd say I've to complain to Linus ?

> That's precisely why we need sys_llseek() on
> the intel platform to get 64-bit partition access.

this is true for 32 bit platforms like Intel but IMHO it's not true
for 64 bit architectures (here: DEC ALpha AXP)

Harald

-- 
All SCSI disks will from now on                     ___       _____
be required to send an email notice                0--,|    /OOOOOOO\
24 hours prior to complete hardware failure!      <_/  /  /OOOOOOOOOOO\
                                                    \  \/OOOOOOOOOOOOOOO\
                                                      \ OOOOOOOOOOOOOOOOO|//
Harald Koenig,                                         \/\/\/\/\/\/\/\/\/
Inst.f.Theoret.Astrophysik                              //  /     \\  \
koenig@tat.physik.uni-tuebingen.de                     ^^^^^       ^^^^^

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: sys_lseek() broken for alpha
       [not found] <199605140011.BAA00734@dax.dcs.ed.ac.uk>
  1996-05-14  9:38 ` sys_lseek() broken for alpha Harald Koenig
@ 1996-05-14 21:08 ` Chris Griffin
  1 sibling, 0 replies; 5+ messages in thread
From: Chris Griffin @ 1996-05-14 21:08 UTC (permalink / raw)


Does this fact mean linux-alpha wont recognize >2gig drives.  I am 
getting a 4 gig in a month I want to make sure it will work!

						Thanks
						Chris

On Tue, 14 May 1996, Stephen C. Tweedie wrote:

> Hi,
> 
> On Mon, 13 May 1996 17:35:32 +0200 (MET DST),
> koenig@tat.physik.uni-tuebingen.de (Harald Koenig) said:
> 
> > sys_lseek() should return off_t which is long (64 bit) for alpha but
> > returns 32bit int.  as a result, fdisk fails for >2GB disks.
> 
> Go and complain to your friendly ANSI / K&R / POSIX guru. :(  I'm
> afraid that the return type NEEDS to be int for compliance with the
> world's libc standards.  That's precisely why we need sys_llseek() on
> the intel platform to get 64-bit partition access.
> 
> Cheers,
>  Stephen.
> --
> Stephen Tweedie <sct@dcs.ed.ac.uk>
> Department of Computer Science, Edinburgh University, Scotland.
> 
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: sys_lseek() broken for alpha
       [not found] <Pine.SOL.3.91.960514170705.22221A-100000@vanadium>
@ 1996-05-14 21:39 ` Harald Koenig
  0 siblings, 0 replies; 5+ messages in thread
From: Harald Koenig @ 1996-05-14 21:39 UTC (permalink / raw)


> Does this fact mean linux-alpha wont recognize >2gig drives.  I am 
> getting a 4 gig in a month I want to make sure it will work!

absolutely no problem, just replace "int" by "off_t" in the kernel sources
for sys_lseek. fdisk works fine then (I just tested it; that the reason why 
I slipped into this; unfortunately I've to give back this disk tomorrow...)
and mk2efs, e2fsck etc. don't have a problem anyway.

Harald

PS: or just use patch-pre2.0.4.gz or newer, just got it and Linus changed 
the return type to long.  Thanks!

-- 
All SCSI disks will from now on                     ___       _____
be required to send an email notice                0--,|    /OOOOOOO\
24 hours prior to complete hardware failure!      <_/  /  /OOOOOOOOOOO\
                                                    \  \/OOOOOOOOOOOOOOO\
                                                      \ OOOOOOOOOOOOOOOOO|//
Harald Koenig,                                         \/\/\/\/\/\/\/\/\/
Inst.f.Theoret.Astrophysik                              //  /     \\  \
koenig@tat.physik.uni-tuebingen.de                     ^^^^^       ^^^^^

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1996-05-14 21:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <199605140011.BAA00734@dax.dcs.ed.ac.uk>
1996-05-14  9:38 ` sys_lseek() broken for alpha Harald Koenig
1996-05-14 21:08 ` Chris Griffin
     [not found] <Pine.SOL.3.91.960514170705.22221A-100000@vanadium>
1996-05-14 21:39 ` Harald Koenig
1996-05-13 15:35 Harald Koenig
1996-05-14  0:11 ` Stephen C. Tweedie

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