mds: drop locks and retry when lock set changes
An optimization was added to avoid an unnecessary gather on the inode
filelock when the client can safely get the file size without also
getting issued the requested caps. However, if a retry of getattr
is necessary, this conditional inclusion of the inode filelock
can cause lock-order violations resulting in deadlock.
So, if we've already acquired some of the inode's locks then we must
drop locks and retry.
Fixes: https://tracker.ceph.com/issues/62052
Fixes: c822b3e2573578c288d170d1031672b74e02dced
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit
b5719ac32fe6431131842d62ffaf7101c03e9bac)