Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Laurence Oberman <loberman@redhat.com>
To: "\"Kai Mäkisara (Kolumbus)\"" <kai.makisara@kolumbus.fi>
Cc: linux-scsi@vger.kernel.org,
	"Martin K . Petersen" <mkp@kernel.org>,
	 "James E . J . Bottomley"
	<James.Bottomley@HansenPartnership.com>,
	John Meneghini <jmeneghi@redhat.com>,
	emilne@redhat.com, 	bgurney@redhat.com
Subject: Re: [PATCH v2 1/2] scsi: st: Restore changed drive settings after reset also for MTLOAD and MTRETEN
Date: Tue, 29 Sep 2026 13:17:15 -0400	[thread overview]
Message-ID: <e666eb713f5a264b294753056c04de64bc3060b0.camel@redhat.com> (raw)
In-Reply-To: <2ABF6AD2-97F0-4373-A47D-1444B27A9593@kolumbus.fi>

On Tue, 2026-09-29 at 17:15 +0300, Kai Mäkisara (Kolumbus) wrote:
> 
> 
> > On 28. Sep 2026, at 16.25, Laurence Oberman <loberman@redhat.com>
> > wrote:
> > 
> > A device reset returns the drive's density and block size to their
> > defaults.  Commit 7081dc75df79 ("scsi: st: Restore some drive
> > settings
> > after reset") re-applies values changed by the user when the
> > position is
> > recovered with MTREW, MTSEEK or MTEOM.  MTLOAD and MTRETEN are also
> > allowed to clear the reset condition and also leave the same medium
> > at
> > BOT, but they restore nothing.
> > 
> > Because check_tape() reads the drive's block size with MODE SENSE
> > on
> > every open, the driver silently switches to the drive default after
> > the
> > reset.  An application that set fixed-block mode with MTSETBLK and
> > recovers with MTLOAD or MTRETEN keeps writing, but variable-length
> > blocks, without any error.
> 
> Reset also returns the drive buffering mode (STp->drv_buffer) to the
> default.
> This should also be restored. It might be possible to use the same
> logic than
> with density and block size. check_tape() reads the possibly damaged
> drv_buffer
> value. So the old value should be saved before check_tape() and
> restored if
> the value after check_tape() differs from the saved value (and the
> saved
> value != 1). (I may have overlooked somthing.)
> 
> Another thing is the auto_lock mode. It should be enough to set
> STp->door_locked = ST_UNLOCKED when reset is recognized. The door
> wiil
> then be locked at first read or write.
> 
> Otherwise I did not find any issues.
> 
> Thanks, Kai
> 
> 
Thanks Kai. Both are new patches in v3: 3/4 records the buffering mode
set with MTSETDRVBUFFER and restores it in both restore paths (it is
already lost when the device is reopened after the reset, so it is
saved when set rather than before check_tape()), and 4/4 sets
door_locked = ST_UNLOCKED when the reset is recognized. Both reproduced
and verified on an IBM LTO-5.


  reply	other threads:[~2026-09-29 17:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28 13:25 [PATCH v2 0/2] scsi: st: Fix drive settings and position after reset recovery with MTLOAD/MTRETEN Laurence Oberman
2026-09-28 13:25 ` [PATCH v2 1/2] scsi: st: Restore changed drive settings after reset also for MTLOAD and MTRETEN Laurence Oberman
2026-09-29 14:15   ` "Kai Mäkisara (Kolumbus)"
2026-09-29 17:17     ` Laurence Oberman [this message]
2026-09-28 13:25 ` [PATCH v2 2/2] scsi: st: Record the tape position after a successful MTLOAD Laurence Oberman
2026-09-29 12:39   ` "Kai Mäkisara (Kolumbus)"
2026-09-29 13:30     ` Laurence Oberman
2026-09-29 17:18     ` Laurence Oberman

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=e666eb713f5a264b294753056c04de64bc3060b0.camel@redhat.com \
    --to=loberman@redhat.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=bgurney@redhat.com \
    --cc=emilne@redhat.com \
    --cc=jmeneghi@redhat.com \
    --cc=kai.makisara@kolumbus.fi \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mkp@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