]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit - libxfs/rdwr.c
repair: avoid ABBA deadlocks on prefetched buffers
authorChristoph Hellwig <lst.de>
Mon, 21 Nov 2011 10:52:32 +0000 (10:52 +0000)
committerChristoph Hellwig <hch@lst.de>
Mon, 21 Nov 2011 10:52:32 +0000 (10:52 +0000)
commit2ae226472bb2eb01d212bb98189c5a5d167a9781
tree419c3387360f223431408909060adea60a0172f2
parent7675c15355a6264828edd4a7bc1436265b12b7a0
repair: avoid ABBA deadlocks on prefetched buffers

Both the prefetch threads and actual repair processing threads can have
multiple buffers at a time locked, but they do no use a common locker
order, which can lead to ABBA deadlocks while trying to lock the buffers.

Switch the prefetch code to do a trylock and skip buffers that have
already been locked to avoid this deadlock.

Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
include/libxfs.h
libxfs/rdwr.c
repair/prefetch.c