]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_copy: don't hang if /all/ the targets hit write errors
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 20 Nov 2017 19:53:56 +0000 (13:53 -0600)
committerEric Sandeen <sandeen@redhat.com>
Mon, 20 Nov 2017 19:53:56 +0000 (13:53 -0600)
commit255c38f87394bc38b0e35b60627f7cb26a4a80bb
tree683554a05411fafea4bfb16dd956b2e6f2ca65ec
parentac9a7bc98eecf7589fcc21568527ce00719b24c0
xfs_copy: don't hang if /all/ the targets hit write errors

If xfs_copy is told to copy a filesystem and /all/ the writer threads
hit an write error, there won't be any threads to unlock mainwait, which
means that write_wbuf will deadlock with itself trying to lock mainwait.
Therefore, if we discover that all the writer threads are dead, just
bail out.

Discovered by running xfs/073 with a tiny test device.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
copy/xfs_copy.c