Skip to content

Commit 397b2d7

Browse files
Darrick J. Wongdgchinner
authored andcommitted
xfs: flush dirty data and drain directios before scrubbing cow fork
When we're scrubbing the COW fork, we need to take MMAPLOCK_EXCL to prevent page_mkwrite from modifying any inode state. The ILOCK should suffice to avoid confusing online fsck, but let's take the same locks that we do everywhere else. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
1 parent 8e698ee commit 397b2d7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

fs/xfs/scrub/bmap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ xchk_setup_inode_bmap(
4242
xfs_ilock(sc->ip, XFS_IOLOCK_EXCL);
4343

4444
/*
45-
* We don't want any ephemeral data fork updates sitting around
45+
* We don't want any ephemeral data/cow fork updates sitting around
4646
* while we inspect block mappings, so wait for directio to finish
4747
* and flush dirty data if we have delalloc reservations.
4848
*/
4949
if (S_ISREG(VFS_I(sc->ip)->i_mode) &&
50-
sc->sm->sm_type == XFS_SCRUB_TYPE_BMBTD) {
50+
sc->sm->sm_type != XFS_SCRUB_TYPE_BMBTA) {
5151
struct address_space *mapping = VFS_I(sc->ip)->i_mapping;
5252

5353
sc->ilock_flags |= XFS_MMAPLOCK_EXCL;

0 commit comments

Comments
 (0)