]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: relax is_reflink_inode assert in xfs_reflink_find_cow_mapping
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 11 Dec 2017 02:03:55 +0000 (18:03 -0800)
committerDarrick J. Wong <darrick.wong@oracle.com>
Thu, 14 Dec 2017 17:20:11 +0000 (09:20 -0800)
commitb5b6c4577ab76e6bf3124b7e286e03bdaefad8bc
tree3615f389875a3556667d4dd35619f84770d7e69e
parente61ab41a3d2acaede03a1f6264c1b197d3625b43
xfs: relax is_reflink_inode assert in xfs_reflink_find_cow_mapping

We don't hold the ilock through the entire sequence of xfs_writepage_map
-> xfs_map_cow -> xfs_reflink_find_cow_mapping.  This means that we can
race with another thread that is trying to clear the inode reflink flag,
with the result that the flag is set for the xfs_map_cow check but
cleared before we get to the assert in find_cow_mapping.  When this
happens, we blow the assert even though everything is fine.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/xfs_reflink.c