diff options
author | Brian Foster <bfoster@redhat.com> | 2019-02-01 09:14:23 -0800 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2019-02-11 16:07:01 -0800 |
commit | 627209fbcc2f0d658a5417645859a1d3053ddb59 (patch) | |
tree | 64c10bff55a217b3d5882326670fc7ad31edcb99 /fs/xfs/libxfs/xfs_rmap_btree.h | |
parent | 3b35089807304f208419b5ad9cc3c5f731225cd9 (diff) | |
download | linux-627209fbcc2f0d658a5417645859a1d3053ddb59.tar.gz linux-627209fbcc2f0d658a5417645859a1d3053ddb59.tar.bz2 linux-627209fbcc2f0d658a5417645859a1d3053ddb59.zip |
xfs: create delalloc bmapi wrapper for full extent allocation
The writeback delalloc conversion code is racy with respect to
changes in the currently cached file mapping. This stems from the
fact that the bmapi allocation code requires a file range to
allocate and the writeback conversion code assumes the range of the
currently cached mapping is still valid with respect to the fork. It
may not be valid, however, because the ilock is cycled (potentially
multiple times) between the time the cached mapping was populated
and the delalloc conversion occurs.
To facilitate a solution to this problem, create a new
xfs_bmapi_delalloc() wrapper to xfs_bmapi_write() that takes a file
(FSB) offset and attempts to allocate whatever delalloc extent backs
the offset. Use a new bmapi flag to cause xfs_bmapi_write() to set
the range based on the extent backing the bno parameter unless bno
lands in a hole. If bno does land in a hole, fall back to the
current behavior (which may result in an error or quietly skipping
holes in the specified range depending on other parameters). This
patch does not change behavior.
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-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/libxfs/xfs_rmap_btree.h')
0 files changed, 0 insertions, 0 deletions