Deadlocks

Answer & solution
Official answer: B
Step through it (5 steps)
1. Current allocations total 3+1+3=7, leaving 9-7=2 drives available. Remaining maximum needs are P1:7-3=4, P2:6-1=5, P3:5-3=2.
2. P3 can receive its remaining two drives and finish. It then returns all five drives, leaving five available to the other processes. Equivalently, in the safety simulation add its existing allocation 3 to the current available count 2.
3. Now P1 can finish and release its three previously allocated drives, raising available to 8; P2 can then finish. Thus P3,P1,P2 is a safe sequence (P3,P2,P1 also works). Existence of a safe sequence establishes safe and not deadlocked, B.