]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: try any AG when allocating the first btree block when reflinking
authorChristoph Hellwig <hch@lst.de>
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)
commitc1587ecf7afb537989f9f2ab8805e6ef2cd61187
treee17af7eb51e1293fb898bb39acaff2e95e7f1f22
parent7a868ee88b7405cf15b8736f639512c786f40b27
xfs: try any AG when allocating the first btree block when reflinking

Source kernel commit: 2fcc319d2467a5f5b78f35f79fd6e22741a31b1e

When a reflink operation causes the bmap code to allocate a btree block
we're currently doing single-AG allocations due to having ->firstblock
set and then try any higher AG due a little reflink quirk we've put in
when adding the reflink code.  But given that we do not have a minleft
reservation of any kind in this AG we can still not have any space in
the same or higher AG even if the file system has enough free space.
To fix this use a XFS_ALLOCTYPE_FIRST_AG allocation in this fall back
path instead.

[And yes, we need to redo this properly instead of piling hacks over
hacks.  I'm working on that, but it's not going to be a small series.
In the meantime this fixes the customer reported issue]

Also add a warning for failing allocations to make it easier to debug.

Signed-off-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>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/libxfs_priv.h
libxfs/xfs_bmap.c
libxfs/xfs_bmap_btree.c