]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commit
xfs: test for premature ENOSPC with large cow delalloc extents
authorDarrick J. Wong <djwong@kernel.org>
Thu, 7 Mar 2024 23:22:55 +0000 (15:22 -0800)
committerZorro Lang <zlang@kernel.org>
Tue, 12 Mar 2024 03:39:52 +0000 (11:39 +0800)
commit70fc4244b7dc015c6d371b3c32ed6d92c4f03b37
tree60c8630a31737cd6042b8e174889c287b1c9a4da
parentb41b9ca96f6947ed99dfe39114b63de6ef8b2e67
xfs: test for premature ENOSPC with large cow delalloc extents

On a higly fragmented filesystem a Direct IO write can fail with -ENOSPC error
even though the filesystem has sufficient number of free blocks.

This occurs if the file offset range on which the write operation is being
performed has a delalloc extent in the cow fork and this delalloc extent
begins much before the Direct IO range.

In such a scenario, xfs_reflink_allocate_cow() invokes xfs_bmapi_write() to
allocate the blocks mapped by the delalloc extent. The extent thus allocated
may not cover the beginning of file offset range on which the Direct IO write
was issued. Hence xfs_reflink_allocate_cow() ends up returning -ENOSPC.

This test addresses this issue.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/rc
tests/xfs/607 [new file with mode: 0755]
tests/xfs/607.out [new file with mode: 0644]