From: Tape Help <tape.help@gmail.com>
To: Kai Makisara <Kai.Makisara@kolumbus.fi>
Cc: linux-scsi@vger.kernel.org, linux-tape@vger.kernel.org
Subject: Re: Fwd: Multi tape problems with cpio
Date: Wed, 19 Jan 2005 18:03:49 -0500 [thread overview]
Message-ID: <12c7da3e05011915036f54cb1c@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0501192023550.6929@kai.makisara.local>
On Wed, 19 Jan 2005 20:50:32 +0200 (EET), Kai Makisara
<Kai.Makisara@kolumbus.fi> wrote:
> On Tue, 18 Jan 2005, Tape Help wrote:
>
> > Ok, I have the debug info, with comments where needed.
> > Thanks alot!
> >
> ...
> > # find home -depth|cpio -o --format=newc --block-size=128 -F /dev/st0
> > 14:24:48 kernel: st0: Block limits 1 - 16777215 bytes.
> > 14:24:48 kernel: st0: Mode sense. Length 11, medium 0, WBS 10, BLL 8
> > 14:24:48 kernel: st0: Density 40, tape length: 0, drv buffer: 1
> > 14:24:48 kernel: st0: Block size: 0, buffer size: 32768 (1 blocks).
> ^
> This shows that your drive is in variable block mode.
>
> > 14:24:48 kernel: st: Succeeded to enlarge buffer to 65536 bytes (segs
> > 1->9, 4096).
> > 16:32:28 kernel: st0: Error: 8000002, cmd: a 0 1 0 0 0 Len: 65536
> > 16:32:28 kernel: Info fld=0x0, EOM Current st09:00: sense key None
> > 16:32:28 kernel: Additional sense indicates End-of-partition/medium detected
> > 16:32:28 kernel: st0: Async write error (write) 7fffffff.
>
> This is actually a 'magic error code' within st: the previous write did
> see the EOM early warning but all data was written. The code 7fffffff is
> later interpreted as succesful write and reported as such but the next
> write then returns the EOM error.
>
> Next I would expect to see a message telling that one filemark is written.
> It can be done by the application but it is also automatically done when
> the device file is closed at this point (i.e., after write). But ...
>
> > 16:32:28 kernel: st0: Unloading tape.
>
> at this point cpio ejects the tape and no filemark is written.
>
> > 16:32:58 kernel: st: Buffer at c0310000 normalized to 32768 bytes (segs 9).
> > # cpio ejected the tape and was waiting for another.
> > # I hit <cntrl>c
> > # I put the tape back in
> > # cpio -i --only-verify-crc --list --block-size=128< /dev/st0
> > 16:40:52 kernel: st0: Error: 8000002, cmd: 0 0 0 0 0 0 Len: 0
> > 16:40:52 kernel: Current st09:00: sense key Unit Attention
> > 16:40:52 kernel: Additional sense indicates Not ready to ready
> > change,medium may have changed
> > 16:40:52 kernel: st0: Block limits 1 - 16777215 bytes.
> > 16:40:52 kernel: st0: Mode sense. Length 11, medium 0, WBS 10, BLL 8
> > 16:40:52 kernel: st0: Density 40, tape length: 0, drv buffer: 1
> > 16:40:52 kernel: st0: Block size: 0, buffer size: 32768 (1 blocks).
> > 16:40:52 kernel: st: Succeeded to enlarge buffer to 65536 bytes (segs
> > 1->9, 4096).
> > 18:45:58 kernel: st0: Error: 8000002, cmd: 8 0 1 0 0 0 Len: 65536
> > 18:45:58 kernel: Info fld=0x10000, Current st09:00: sense key Blank Check
> > 18:45:58 kernel: Additional sense indicates End-of-data detected
> > 18:45:58 kernel: st0: Sense: f0 0 8 0 1 0 0 e
>
> Now st encounters end of data and this is reported as read error.
>
> My drive behaves in a slightly different way: it returns the same data but
> it also sets the EOM bit. In this case the st driver interprets the
> situation as normal end of data assuming that this is where the writing
> application stopped writing.
>
> > 18:45:58 kernel: st0: Tape error while reading.
> > 18:45:58 kernel: st0: Rewinding tape.
> > 18:46:07 kernel: st: Buffer at c0310000 normalized to 32768 bytes (segs 9).
> > # cpio give this error: cpio: read error: Input/output error
> >
>
> So, your debugging data and my debugging data revealed what was happening
> and why we had different results. It is debatable what is the basic
> problem. The st driver is working as it has been designed to work but this does
> not match the expectations of cpio. My opinion is that any application
> should at least try to write a filemark at the end of each tape file and
> not rely on certain behaviour of drives and drivers at the end of an
> incomplete file. This is especially important because there is no common
> standard for tape semantics.
>
> The problem can be solved by either changing st semantics or cpio
> behavior. Before changing st semantics I would like to be convinced that
> the changed semantics is what all (most) other unix tape drivers use. Any
> change of semantics can break other applications.
>
> I will forward this analysis (with a preface) to the cpio maintainers.
>
> --
> Kai
>
Are the cpio maintainers on a list?
I would like to monitor the status of this issue.
Thanks for spending your time and effort on this.
next prev parent reply other threads:[~2005-01-19 23:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <12c7da3e0501132353150d51f2@mail.gmail.com>
2005-01-15 7:32 ` Fwd: Multi tape problems with cpio Tape Help
2005-01-16 18:47 ` Kai Makisara
2005-01-16 19:28 ` Tape Help
2005-01-19 0:16 ` Tape Help
2005-01-19 18:50 ` Kai Makisara
2005-01-19 23:03 ` Tape Help [this message]
2005-01-20 21:07 ` Kai Makisara
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=12c7da3e05011915036f54cb1c@mail.gmail.com \
--to=tape.help@gmail.com \
--cc=Kai.Makisara@kolumbus.fi \
--cc=linux-scsi@vger.kernel.org \
--cc=linux-tape@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox