All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] st: Do not rewind for SG_IO
@ 2014-01-31  8:46 Hannes Reinecke
  2014-01-31 16:36 ` Jeremy Linton
  2014-01-31 16:43 ` Jeremy Linton
  0 siblings, 2 replies; 25+ messages in thread
From: Hannes Reinecke @ 2014-01-31  8:46 UTC (permalink / raw)
  To: James Bottomley; +Cc: Kay Sievers, Kai Makisara, linux-scsi, Hannes Reinecke

Plain 'st' devices are defined to do a rewind on close.
This causes quite some issues when trying to read the
VPD pages to figure out the WWN of the device.
Especially for udev this means we either have to use
another (non-rewinding) device node for this
(and thereby introducing race conditions) or not
generating a persistent device node at all
(and breaking multi-tape setups).

This patch make the tape always non-rewinding
when SG_IO is used, thus allowing udev to get
a proper device id for tapes.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 drivers/scsi/st.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index dc4826c..da18ce5 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -3645,6 +3645,9 @@ static long st_ioctl(struct file *file, unsigned int cmd_in, unsigned long arg)
 		case SCSI_IOCTL_GET_IDLUN:
 		case SCSI_IOCTL_GET_BUS_NUMBER:
 			break;
+		case SG_IO:
+			STp->rew_at_close = 0;
+			/* Fallthrough */
 		default:
 			if ((cmd_in == SG_IO ||
 			     cmd_in == SCSI_IOCTL_SEND_COMMAND ||
-- 
1.7.12.4


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

end of thread, other threads:[~2014-02-06 19:21 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-31  8:46 [PATCH] st: Do not rewind for SG_IO Hannes Reinecke
2014-01-31 16:36 ` Jeremy Linton
2014-01-31 16:43 ` Jeremy Linton
2014-02-01 14:06   ` Hannes Reinecke
2014-02-01 15:23     ` "Kai Mäkisara (Kolumbus)"
2014-02-02 11:42       ` Hannes Reinecke
2014-02-02 19:15         ` "Kai Mäkisara (Kolumbus)"
2014-02-03  6:55           ` Hannes Reinecke
2014-02-03 14:50         ` Jeremy Linton
2014-02-03 15:06           ` Hannes Reinecke
2014-02-03 15:08             ` Jeremy Linton
2014-02-03 20:51               ` Kay Sievers
2014-02-03 21:11                 ` James Bottomley
2014-02-03 21:58                 ` Jeremy Linton
2014-02-03 22:15                   ` Kay Sievers
2014-02-03 22:26                     ` Jeremy Linton
2014-02-06 13:10                   ` Hannes Reinecke
2014-02-06 13:21                     ` Martin K. Petersen
2014-02-06 13:26                       ` Hannes Reinecke
2014-02-06 13:50                         ` Martin K. Petersen
2014-02-06 14:38                           ` James Bottomley
2014-02-06 15:13                             ` Hannes Reinecke
2014-02-06 19:21                               ` Douglas Gilbert
2014-02-03 21:16               ` Douglas Gilbert
2014-02-03 21:24                 ` Kay Sievers

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.