Re: st: Fixup -ENOMEDIUM

Hannes Reinecke
2006-10-06T09:19:20Z

Kai Makisara wrote:
> On Thu, 5 Oct 2006, Hannes Reinecke wrote:
>
>> Hi all,
>>
>> currently the tape driver doesn't believe in ENOMEDIUM. Even if the sense code
>> from TUR indicates that no tape is present the command will be retried; maybe
>> the user is fast enough to slip a medium in in the meantime ...
>> And even if not, it will return 'EIO' in any case.
>>
> The driver implements (up to a point) the Single Unix Specification: if
> O_NONBLOCK is clear, open() shall wait until the device is ready or
> available. It does not wait indefinitely but implements a timeout. This is
> the behaviour I found experimentally in some other Unices.
>
Ah. Ok; you're the maintainer, you get to decide.

>> This patch fixes the ENOMEDIUM handling: TUR will _not_ be retried if no
>> medium is present and the correct error number ENOMEDIUM will be set on exit.
>>
> It is true that st_open() does not currently return ENOMEDIUM and your fix
> for this is correct.
>
>> Please apply.
>>
> I don't think that the first and second parts should be applied. The third
> part fixes a bug and it should be applied. I include at the end a diff
> containing only that part.
>
Right. Thanks.

> -----------8<--------------------
>
> Fix st_open() to return -ENOMEDIUM instead of -EIO if no medium is
> found.
>
> Signed-off-by: Kai Makisara <kai.makisara@kolumbus.fi>
>
Signed-off-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
--
Dr. Hannes Reinecke hare@suse.de
SuSE Linux Products GmbH S390 & zSeries
Maxfeldstraße 5 +49 911 74053 688
90409 Nürnberg http://www.suse.de
-
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