Commit 397b2d7e authored by Darrick J. Wong's avatar Darrick J. Wong Committed by Dave Chinner

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: default avatarDarrick J. Wong <djwong@kernel.org>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
parent 8e698ee7
...@@ -42,12 +42,12 @@ xchk_setup_inode_bmap( ...@@ -42,12 +42,12 @@ xchk_setup_inode_bmap(
xfs_ilock(sc->ip, XFS_IOLOCK_EXCL); xfs_ilock(sc->ip, XFS_IOLOCK_EXCL);
/* /*
* We don't want any ephemeral data fork updates sitting around * We don't want any ephemeral data/cow fork updates sitting around
* while we inspect block mappings, so wait for directio to finish * while we inspect block mappings, so wait for directio to finish
* and flush dirty data if we have delalloc reservations. * and flush dirty data if we have delalloc reservations.
*/ */
if (S_ISREG(VFS_I(sc->ip)->i_mode) && if (S_ISREG(VFS_I(sc->ip)->i_mode) &&
sc->sm->sm_type == XFS_SCRUB_TYPE_BMBTD) { sc->sm->sm_type != XFS_SCRUB_TYPE_BMBTA) {
struct address_space *mapping = VFS_I(sc->ip)->i_mapping; struct address_space *mapping = VFS_I(sc->ip)->i_mapping;
sc->ilock_flags |= XFS_MMAPLOCK_EXCL; sc->ilock_flags |= XFS_MMAPLOCK_EXCL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment