summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_iomap.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-08-07 10:57:12 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2018-08-07 10:57:12 -0700
commit2ba090d521c5e09f32316c179d25bb6f699d3568 (patch)
tree1171512eca076f1e10fea00dcf8e07766486c1a4 /fs/xfs/xfs_iomap.c
parenta0e336ba3e3d1c7ec0f738a2e2e203434c00b08e (diff)
xfs: use WRITE_ONCE to update if_seq
This adds ordering of the updates and makes sure we always see the if_seq update before the extent tree is modified. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/xfs_iomap.c')
-rw-r--r--fs/xfs/xfs_iomap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index 3282575e2df4..6320aca39f39 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -655,6 +655,7 @@ xfs_iomap_write_allocate(
unsigned int *cow_seq)
{
xfs_mount_t *mp = ip->i_mount;
+ struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork);
xfs_fileoff_t offset_fsb, last_block;
xfs_fileoff_t end_fsb, map_start_fsb;
xfs_filblks_t count_fsb;
@@ -768,7 +769,7 @@ xfs_iomap_write_allocate(
goto error0;
if (whichfork == XFS_COW_FORK)
- *cow_seq = XFS_IFORK_PTR(ip, whichfork)->if_seq;
+ *cow_seq = READ_ONCE(ifp->if_seq);
xfs_iunlock(ip, XFS_ILOCK_EXCL);
}