]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
xfs: return a referenced perag from filestreams allocator
authorDave Chinner <dchinner@redhat.com>
Tue, 9 May 2023 09:30:46 +0000 (11:30 +0200)
committerCarlos Maiolino <cem@kernel.org>
Wed, 10 May 2023 13:00:44 +0000 (15:00 +0200)
commitc371ca854a96a99f0b94e1f431975cefd88d60cd
treed4f56b09a8a9d7438f8b06f062b38282aef14f65
parent12ae681874a07011c4cb75224693c155d7cd1284
xfs: return a referenced perag from filestreams allocator

Source kernel commit: f8f1ed1ab3babad46b25e2dbe8de43b33fe7aaa6

Now that the filestreams AG selection tracks active perags, we need
to return an active perag to the core allocator code. This is
because the file allocation the filestreams code will run are AG
specific allocations and so need to pin the AG until the allocations
complete.

We cannot rely on the filestreams item reference to do this - the
filestreams association can be torn down at any time, hence we
need to have a separate reference for the allocation process to pin
the AG after it has been selected.

This means there is some perag juggling in allocation failure
fallback paths as they will do all AG scans in the case the AG
specific allocation fails. Hence we need to track the perag
reference that the filestream allocator returned to make sure we
don't leak it on repeated allocation failure.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
libxfs/xfs_bmap.c