Falsifying the "Circular Wait" Condition - Deadlock Prevention
It's fixed.  Your example violates the protocol.  If the process needs mutually exclusive access to both the tape drive and the disk drive, then it needs to take locks in increasing order, i.e. first the tape drive then the disk drive.  If it wants to use the disk drive before the tape drive, that's fine, it will just be holding the tape drive lock in the mean time.

The ordering and protocol is a global invariant.  All code everywhere at all times needs to follow the protocol to avoid deadlock.  In practice, this is pretty difficult to enforce in realistic code unless there's a manager that handles resource access.