OSDN Git Service

xfs: lock out page faults from extent swap operations
authorDave Chinner <dchinner@redhat.com>
Mon, 23 Feb 2015 10:47:29 +0000 (21:47 +1100)
committerDave Chinner <david@fromorbit.com>
Mon, 23 Feb 2015 10:47:29 +0000 (21:47 +1100)
commit723cac48473358939759885a18e8df113ea96138
tree2733e572223f4b097fc282767394849d6522711b
parent0f9160b444e4de33b65dfcd3b901358a3129461a
xfs: lock out page faults from extent swap operations

Extent swap operations are another extent manipulation operation
that we need to ensure does not race against mmap page faults. The
current code returns if the file is mapped prior to the swap being
done, but it could potentially race against new page faults while
the swap is in progress. Hence we should use the XFS_MMAPLOCK_EXCL
for this operation, too.

While there, fix the error path handling that can result in double
unlocks of the inodes when cancelling the swapext transaction.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/xfs_bmap_util.c