Details
-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
None
-
None
-
9223372036854775807
Description
In current implementation, the client uses LCK_EX lock mode for layout lock when issue a layout change intent RPC to MDS. This will grant LCK_EX layout lock to the client. However, the latter restarting I/O will refresh layout, which only matches LCK_CR | LCK_CW | LCK_PR | LCK_PW mode of cached layout lock locally. it will result in reacquiring CR layout lock from MDS and cancel the previously granted EX layout lock to the client via lock blocking callback.
This patch avoids the this kind of unnecessary lock conflict by using LCK_CR mode directly when issue the layout change intent RPC to MDS. And when MDS received this request, it will first take EX layout lock and change the layout at will according to the write intent, and release the EX layout lock. After that, return a CR layout lock together with layout informatiom to client for latter I/O.