From: Christoph Hellwig <hch@lst.de>
To: "Elliott, Robert (Server Storage)" <Elliott@hp.com>
Cc: Christoph Hellwig <hch@lst.de>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
Douglas Gilbert <dgilbert@interlog.com>
Subject: Re: [PATCH 4/6] st: call scsi_set_medium_removal directly
Date: Sat, 8 Nov 2014 14:26:23 +0100 [thread overview]
Message-ID: <20141108132623.GA22610@lst.de> (raw)
In-Reply-To: <94D0CD8314A33A4D9D801C0FE68B402959378554@G4W3202.americas.hpqcorp.net>
On Thu, Nov 06, 2014 at 11:54:41PM +0000, Elliott, Robert (Server Storage) wrote:
> A few comments spawned by this (and patch 5/6):
>
> 1. Although PREVENT ALLOW MEDIUM REMOVAL was a generic
> command defined in SPC-2, In 2006 T10 proposal
> 06-248r1 changed it to be a command-set specific
> command for SPC-3. MMC, SSC, SBC, and SMC had slight
> differences and the groups wouldn't agree on a converged
> definition.
>
> For example:
> * SSC and SBC only define two of the bit combinations
> in byte 4 bits 1:0 - allowed and prevented
> * MMC defines all four combinations of byte 4 bits 1:0 -
> unlocked, locked, persistent allow, and persistent prevent
> * SMC follows SSC/SBC but adds a PREEMPT bit in
> byte 4 bit 7
>
> So, relying on one SCSI-wide scsi_set_medium_removal
> call could theoretically be a problem (though not yet,
> since none of those extra features are used).
The scsi_set_medium_removal is fairly trivial. For the unlikely case
that we are going to make use of these additional features we'll
need to split it.
> 2. Reviewing the callers for scsi_set_medium_removal,
> I noticed sd.c sd_release ignores the return value
> from scsi_set_medium_removal (like many others).
>
> Its comment says:
> * Returns 0.
> but it is a void function so doesn't really return anything:
> static void sd_release(struct gendisk *disk, fmode_t mode)
Right. That's actually a fairly recent change from Al, before
that the ->release method for block devices had a return value,
which we then always iŋnored higher up.
> 3. Reviewing the callers, st_release has an initialized
> result variable but does nothing else with it but return it:
> int result = 0;
> ...
> return result;
>
> It ignores the do_door_lock -> scsi_set_medium_removal
> result (like many others).
The st driver defintively could use an audit for error code propagation.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-11-08 13:26 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-30 9:27 misc scsi ioctl updates V2 Christoph Hellwig
2014-10-30 9:27 ` [PATCH 1/6] scsi: refactor scsi_reset_provider handling Christoph Hellwig
2014-10-30 9:38 ` Hannes Reinecke
2014-11-05 14:11 ` Hannes Reinecke
2014-11-05 14:25 ` Martin K. Petersen
2014-11-06 18:01 ` Elliott, Robert (Server Storage)
2014-10-30 9:27 ` [PATCH 2/6] scsi: split scsi_nonblockable_ioctl Christoph Hellwig
2014-11-05 14:12 ` Hannes Reinecke
2014-11-05 14:28 ` Martin K. Petersen
2014-11-06 22:35 ` Elliott, Robert (Server Storage)
2014-10-30 9:27 ` [PATCH 3/6] sd: fix up ->compat_ioctl Christoph Hellwig
2014-10-30 9:40 ` Hannes Reinecke
2014-11-05 14:13 ` Hannes Reinecke
2014-11-05 14:29 ` Martin K. Petersen
2014-11-06 21:41 ` Elliott, Robert (Server Storage)
2014-10-30 9:27 ` [PATCH 4/6] st: call scsi_set_medium_removal directly Christoph Hellwig
2014-11-05 14:13 ` Hannes Reinecke
2014-11-05 14:31 ` Martin K. Petersen
2014-11-06 23:54 ` Elliott, Robert (Server Storage)
2014-11-08 13:26 ` Christoph Hellwig [this message]
2014-11-09 19:18 ` "Kai Mäkisara (Kolumbus)"
2014-10-30 9:27 ` [PATCH 5/6] osst: " Christoph Hellwig
2014-11-05 14:14 ` Hannes Reinecke
2014-11-05 14:31 ` Martin K. Petersen
2014-11-07 0:01 ` Elliott, Robert (Server Storage)
2014-10-30 9:27 ` [PATCH 6/6] scsi: return EAGAIN when resetting a device under EH Christoph Hellwig
2014-11-05 14:14 ` Hannes Reinecke
2014-11-05 14:33 ` Martin K. Petersen
2014-11-06 21:46 ` Elliott, Robert (Server Storage)
2014-11-06 22:55 ` Douglas Gilbert
-- strict thread matches above, loose matches on Subject: below --
2014-10-27 17:59 misc scsi ioctl updates Christoph Hellwig
2014-10-27 17:59 ` [PATCH 4/6] st: call scsi_set_medium_removal directly Christoph Hellwig
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=20141108132623.GA22610@lst.de \
--to=hch@lst.de \
--cc=Elliott@hp.com \
--cc=dgilbert@interlog.com \
--cc=linux-scsi@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 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.