]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xfs: fix incorrect extent state in xfs_bmap_add_extent_unwritten_real
authorChristoph Hellwig <hch@lst.de>
Tue, 17 Oct 2017 21:16:19 +0000 (14:16 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Thu, 26 Oct 2017 22:38:20 +0000 (15:38 -0700)
commit5e422f5e4fd71d18bc6b851eeb3864477b3d842e
tree778389d1da29b195efa1296821505eaea2bfd038
parent232b51948b99dfcc95e81d8a289bc0409b3ff5b3
xfs: fix incorrect extent state in xfs_bmap_add_extent_unwritten_real

There was one spot in xfs_bmap_add_extent_unwritten_real that didn't use the
passed in new extent state but always converted to normal, leading to wrong
behavior when converting from normal to unwritten.

Only found by code inspection, it seems like this code path to move partial
extent from written to unwritten while merging it with the next extent is
rarely exercised.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/libxfs/xfs_bmap.c