]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
xfs: acquire superblock freeze protection on eofblocks scans
authorBrian Foster <bfoster@redhat.com>
Sun, 12 Apr 2020 20:11:10 +0000 (13:11 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Thu, 14 May 2020 08:54:28 +0000 (10:54 +0200)
commite9df6245c9d9f875f6fc7290b968d1b48b6d66f1
treed0461545e930afb26d7103830368f72267a836d6
parent08983c09fa31df405e25affab004f1f9ac23c318
xfs: acquire superblock freeze protection on eofblocks scans

BugLink: https://bugs.launchpad.net/bugs/1878256
commit 4b674b9ac852937af1f8c62f730c325fb6eadcdb upstream.

The filesystem freeze sequence in XFS waits on any background
eofblocks or cowblocks scans to complete before the filesystem is
quiesced. At this point, the freezer has already stopped the
transaction subsystem, however, which means a truncate or cowblock
cancellation in progress is likely blocked in transaction
allocation. This results in a deadlock between freeze and the
associated scanner.

Fix this problem by holding superblock write protection across calls
into the block reapers. Since protection for background scans is
acquired from the workqueue task context, trylock to avoid a similar
deadlock between freeze and blocking on the write lock.

Fixes: d6b636ebb1c9f ("xfs: halt auto-reclamation activities while rebuilding rmap")
Reported-by: Paul Furtado <paulfurtado91@gmail.com>
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Chandan Rajendra <chandanrlinux@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Allison Collins <allison.henderson@oracle.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
fs/xfs/xfs_icache.c
fs/xfs/xfs_ioctl.c