All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 2.6.12 1/1] st: support ANSI end-of-volume processing
@ 2005-06-27 19:15 John W. Linville
  2005-06-27 19:43 ` Kai Makisara
  0 siblings, 1 reply; 2+ messages in thread
From: John W. Linville @ 2005-06-27 19:15 UTC (permalink / raw)
  To: Kai.Makisara; +Cc: linux-scsi, Fabien.Collin, Jean-Philippe.Baud

The ANSI labelled tape standard specifies that the EOD on tape must be
preceeded by a trailer label.  If during writing your application hits
LEOT (Logical End Of Tape), it must be able to write the trailer label.
However with the default tape driver (st), you cannot write anything
after the LEOT. So the patch clears the error condition so that the
application can write the trailer label (there is some space available
on tape media between LEOT and PEOT=Physical End Of Tape).

Signed-off-by: Fabien Collin <Fabien.Collin@cern.ch>
Signed-off-by: Jean-Philippe Baud <Jean-Philippe.Baud@cern.ch>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
Original patch by Fabien Collin.  Description above by Jean-Philippe
Baud.  Patch monkeying by me...  Honestly, I don't know a lot about
this patch.  But, I am told it "works"...  If you have questions
regarding this, send them to me and I'll get an answer for you.

 drivers/scsi/st.c |    1 +
 1 files changed, 1 insertion(+)

diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -3440,6 +3440,7 @@ static int st_ioctl(struct inode *inode,
 		}
 
 		STp->recover_reg = 0;		/* Clear after read */
+		STps->eof = ST_NOEOF;
 		retval = 0;
 		goto out;
 	}			/* End of MTIOCGET */
-- 
John W. Linville
linville@tuxdriver.com

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

* Re: [patch 2.6.12 1/1] st: support ANSI end-of-volume processing
  2005-06-27 19:15 [patch 2.6.12 1/1] st: support ANSI end-of-volume processing John W. Linville
@ 2005-06-27 19:43 ` Kai Makisara
  0 siblings, 0 replies; 2+ messages in thread
From: Kai Makisara @ 2005-06-27 19:43 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-scsi, Fabien.Collin, Jean-Philippe.Baud

On Mon, 27 Jun 2005, John W. Linville wrote:

> The ANSI labelled tape standard specifies that the EOD on tape must be
> preceeded by a trailer label.  If during writing your application hits
> LEOT (Logical End Of Tape), it must be able to write the trailer label.
> However with the default tape driver (st), you cannot write anything
> after the LEOT.

This is not true. Quoting from linux/Documentation/scsi/st.txt:

"When the end of medium early warning is encountered, the current write
is finished and the number of bytes is returned. The next write
returns -1 and errno is set to ENOSPC. To enable writing a trailer,
the next write is allowed to proceed and, if successful, the number of
bytes is returned. After this, -1 and the number of bytes are
alternately returned until the physical end of medium (or some other
error) is encountered."

(Yes, this should be added to the man page ;-)

> So the patch clears the error condition so that the
> application can write the trailer label (there is some space available
> on tape media between LEOT and PEOT=Physical End Of Tape).
> 
If this new way is what users want and it does not break existing 
applications, it should be added. Especially if it is the way some other 
common system behaves. However, when the semantics are changed, the 
documentation in the kernel sources should also be updated.

-- 
Kai

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

end of thread, other threads:[~2005-06-27 19:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-27 19:15 [patch 2.6.12 1/1] st: support ANSI end-of-volume processing John W. Linville
2005-06-27 19:43 ` Kai Makisara

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.