]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: avoid mount-time deadlock in CoW extent recovery
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 13 Jun 2017 19:55:31 +0000 (14:55 -0500)
committerEric Sandeen <sandeen@redhat.com>
Tue, 13 Jun 2017 19:55:31 +0000 (14:55 -0500)
commitd4e8eb2e40ed705d27877c04333405c64aae3201
tree43edf53f1c7fb17308275a70fb554ac86a218cda
parent07f98c31d693731c05fd79b58cc3993f9a8fb359
xfs: avoid mount-time deadlock in CoW extent recovery

Source kernel commit: 3ecb3ac7b950ff8f6c6a61e8b7b0d6e3546429a0

If a malicious user corrupts the refcount btree to cause a cycle between
different levels of the tree, the next mount attempt will deadlock in
the CoW recovery routine while grabbing buffer locks.  We can use the
ability to re-grab a buffer that was previous locked to a transaction to
avoid deadlocks, so do that here.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
include/xfs_trans.h
libxfs/libxfs_api_defs.h
libxfs/trans.c
libxfs/xfs_refcount.c