]> www.infradead.org Git - users/hch/xfsprogs.git/commit
xfs: allow unwritten extents in the CoW fork
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 4 Apr 2017 20:37:44 +0000 (15:37 -0500)
committerEric Sandeen <sandeen@redhat.com>
Tue, 4 Apr 2017 20:37:44 +0000 (15:37 -0500)
commit4072e4b45d2988421d876e12e60dd0d422b4e9f4
treeac5b86696125e28a3b36c7631d2a5f7735a03798
parent9fe64e8d01893393ed6013d5ff013c719b32666a
xfs: allow unwritten extents in the CoW fork

Source kernel commit: 05a630d76bd3f39baf0eecfa305bed2820796dee

In the data fork, we only allow extents to perform the following state
transitions:

delay -> real <-> unwritten

There's no way to move directly from a delalloc reservation to an
/unwritten/ allocated extent.  However, for the CoW fork we want to be
able to do the following to each extent:

delalloc -> unwritten -> written -> remapped to data fork

This will help us to avoid a race in the speculative CoW preallocation
code between a first thread that is allocating a CoW extent and a second
thread that is remapping part of a file after a write.  In order to do
this, however, we need two things: first, we have to be able to
transition from da to unwritten, and second the function that converts
between real and unwritten has to be made aware of the cow fork.  Do
both of those things.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_bmap.c