linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Q: 2.4.[37]-XFS: /dev/nst0m: cannot allocate memory
@ 2001-08-17 20:05 Martin Jacobs
  2001-08-18  7:38 ` Kai Makisara
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Jacobs @ 2001-08-17 20:05 UTC (permalink / raw)
  To: linux-kernel; +Cc: Albrecht Jacobs

Hi all,

I cannot read anything from my tape (Tandberg DLT8000, LVD
interface, ID=5) connected to an aic7899 or an sym53c895 using
kernel 2.4.3-XFS or 2.4.7-XFS. (Everything works fine on
2.2.16.) Loading of st.o works. stinit works. mt (status, tape
positioning) works. But when I try to read the amanda header
from the tape (dd if=/dev/nst0m bs=32k count=1) I get the
error

dd: reading `/dev/nst0m': Cannot allocate memory

The syslog says:

Jul 29 17:49:28 depp kernel: sym53c895-0-<5,*>: FAST-10 WIDE SCSI 20.0MB/s (100.0 ns, offset 15)
Jul 29 17:49:28 depp kernel: st0: Block limits 2 - 16777214 bytes.

strace gives something like:

...
open("/dev/nst0m", O_RDONLY|O_LARGEFILE) = 0
...
read(0, 0x8052000, 32768)               = -1 ENOMEM (Cannot
allocate
memory)
...

Nearly the same for tar (with default block size of 512 byte).

BUT: if I use bs=64k it works!!?

TIA

-- 
albrecht jacobs

jangled nerves gmbh
hallstrasse 25
d-70376 stuttgart

fon:   +49 711 550375-44
fax:   +49 711 550375-22

mailto:albrecht.jacobs@janglednerves.com
http://www.janglednerves.com/




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

* Re: Q: 2.4.[37]-XFS: /dev/nst0m: cannot allocate memory
  2001-08-17 20:05 Q: 2.4.[37]-XFS: /dev/nst0m: cannot allocate memory Martin Jacobs
@ 2001-08-18  7:38 ` Kai Makisara
  2001-08-19 18:59   ` Albrecht Jacobs
  0 siblings, 1 reply; 4+ messages in thread
From: Kai Makisara @ 2001-08-18  7:38 UTC (permalink / raw)
  To: (Martin Jacobs); +Cc: linux-kernel, Albrecht Jacobs

On Fri, 17 Aug 2001, (Martin Jacobs) wrote:

> Hi all,
>
> I cannot read anything from my tape (Tandberg DLT8000, LVD
> interface, ID=5) connected to an aic7899 or an sym53c895 using
> kernel 2.4.3-XFS or 2.4.7-XFS. (Everything works fine on
> 2.2.16.) Loading of st.o works. stinit works. mt (status, tape
> positioning) works. But when I try to read the amanda header
> from the tape (dd if=/dev/nst0m bs=32k count=1) I get the
> error
>
> dd: reading `/dev/nst0m': Cannot allocate memory
>
...
> Nearly the same for tar (with default block size of 512 byte).
>
> BUT: if I use bs=64k it works!!?
>
In variable block mode in 2.4, you get ENOMEM if the block on the tape is
larger than the byte count in the read(). 2.2 just returned what you asked
for and silentlry threw away the rest of the block. If the byte count is
larger than the block size, then the block is returned.

I.e., the first block on your tape is larger than 32 kB.

	Kai



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

* Re: Q: 2.4.[37]-XFS: /dev/nst0m: cannot allocate memory
  2001-08-18  7:38 ` Kai Makisara
@ 2001-08-19 18:59   ` Albrecht Jacobs
  2001-08-19 19:44     ` Kai Makisara
  0 siblings, 1 reply; 4+ messages in thread
From: Albrecht Jacobs @ 2001-08-19 18:59 UTC (permalink / raw)
  To: Kai Makisara; +Cc: (Martin Jacobs), linux-kernel

Kai Makisara wrote:
> 
> On Fri, 17 Aug 2001, (Martin Jacobs) wrote:
> 
> > Hi all,
> >
> > I cannot read anything from my tape (Tandberg DLT8000, LVD
> > interface, ID=5) connected to an aic7899 or an sym53c895 using
> > kernel 2.4.3-XFS or 2.4.7-XFS. (Everything works fine on
> > 2.2.16.) Loading of st.o works. stinit works. mt (status, tape
> > positioning) works. But when I try to read the amanda header
> > from the tape (dd if=/dev/nst0m bs=32k count=1) I get the
> > error
> >
> > dd: reading `/dev/nst0m': Cannot allocate memory
> >
> ...
> > Nearly the same for tar (with default block size of 512 byte).
> >
> > BUT: if I use bs=64k it works!!?
> >
> In variable block mode in 2.4, you get ENOMEM if the block on the tape is
> larger than the byte count in the read(). 2.2 just returned what you asked
> for and silentlry threw away the rest of the block. If the byte count is
> larger than the block size, then the block is returned.
> 
> I.e., the first block on your tape is larger than 32 kB.
> 
>         Kai

If I understand you right this is a FEATURE, not a bug! I find it quite
irritating when using a tape device. Shouldn't I get some error message
about wrong block size?
	Forgive me but I am some sort of end user (admin) and not a kernel
hacker.
BTW, where can I get documentation about this 'feature'?
 
Thanks anyway!

-- 
albrecht jacobs

jangled nerves gmbh
hallstrasse 25
d-70376 stuttgart

fon:   +49 711 550375-44
fax:   +49 711 550375-22

mailto:albrecht.jacobs@janglednerves.com
http://www.janglednerves.com/

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

* Re: Q: 2.4.[37]-XFS: /dev/nst0m: cannot allocate memory
  2001-08-19 18:59   ` Albrecht Jacobs
@ 2001-08-19 19:44     ` Kai Makisara
  0 siblings, 0 replies; 4+ messages in thread
From: Kai Makisara @ 2001-08-19 19:44 UTC (permalink / raw)
  To: Albrecht Jacobs; +Cc: (Martin Jacobs), linux-kernel

On Sun, 19 Aug 2001, Albrecht Jacobs wrote:

> Kai Makisara wrote:
> >
...
> > In variable block mode in 2.4, you get ENOMEM if the block on the tape is
> > larger than the byte count in the read(). 2.2 just returned what you asked
> > for and silentlry threw away the rest of the block. If the byte count is
> > larger than the block size, then the block is returned.
> >
> > I.e., the first block on your tape is larger than 32 kB.
> >
> >         Kai
>
> If I understand you right this is a FEATURE, not a bug! I find it quite
> irritating when using a tape device. Shouldn't I get some error message
> about wrong block size?

Yes, it is a feature. The behaviour of the Linux driver was changed in
2.4 to match the behaviour of other Unix tape drivers in this case.

It is legal to read blocks that are smaller than the byte count and so
the non-matching block size is not an error as such. It is an error only if
the block is larger than the requested size and this error is returned to
the user. I admit that the code ENOMEM is not too informative but there is
not an error code for too big block size.

> 	Forgive me but I am some sort of end user (admin) and not a kernel
> hacker.
> BTW, where can I get documentation about this 'feature'?
>
It seems that the st man page only documents the 2.2 behaviour (my fault).

I have not seen a good tutorial for tape operations in Unix. The man pages
document some things. The basic rule is that you must know the block
size(s) on the tape and set the parameters accordingly.

	Kai



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

end of thread, other threads:[~2001-08-19 19:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-17 20:05 Q: 2.4.[37]-XFS: /dev/nst0m: cannot allocate memory Martin Jacobs
2001-08-18  7:38 ` Kai Makisara
2001-08-19 18:59   ` Albrecht Jacobs
2001-08-19 19:44     ` Kai Makisara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).