Subject: Re: "Device Busy", how to clear?
To: None <rickgc@calweb.com>
From: maximum entropy <entropy@zippy.bernstein.com>
List: port-vax
Date: 12/07/1998 20:49:20
>From: Rick Copeland <rickgc@calweb.com>
>
>I am using a uVAX 3600 with a TU81+, now and then I get a "device busy"
>after I execute a command like mt -f /dev/nrmt0 fsf 2 when the tape deck is
>offline (at the deck).  How do I clear this "device busy" with out having
>to down the entire system?

I suspect there's a bug in /sys/arch/vax/mscp/mscp_tape.c:mtopen().

        if (mt->mt_inuse)
                        return EBUSY;
        mt->mt_inuse = 1;

        if (mt_putonline(mt) == MSCP_FAILED)
                return EIO;

        return 0;

If mt_putonline() fails, mt->mt_inuse will be set but the device won't
be opened.  It will therefore never get closed, and will be stuck
always returning EBUSY ("device busy").  I think the mt->mt_inuse flag
should be set just before the return.

I don't have a suitable system for testing.  This is only a guess.

Cheers,
entropy

--
entropy -- it's not just a good idea, it's the second law.