]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: force writes to delalloc regions to unwritten
authorDarrick J. Wong <darrick.wong@oracle.com>
Sat, 23 May 2020 16:43:31 +0000 (09:43 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Wed, 27 May 2020 15:49:28 +0000 (08:49 -0700)
commitbc78f7669ef5748fd1e1da8b433b40cc2af19d46
treeecfae2d1263b9a6b5999c6351c7bd3bbb0d44543
parent9af6f67d049b7b3b3432881225d45b6ee0a8b7ce
xfs: force writes to delalloc regions to unwritten

When writing to a delalloc region in the data fork, commit the new
allocations (of the da reservation) as unwritten so that the mappings
are only marked written once writeback completes successfully.  This
fixes the problem of stale data exposure if the system goes down during
targeted writeback of a specific region of a file, as tested by
generic/042.

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