]> www.infradead.org Git - users/hch/misc.git/commit
xfs: fix finding a last resort AG in xfs_filestream_pick_ag xfs-filesystems-pick-fix
authorChristoph Hellwig <hch@lst.de>
Tue, 22 Oct 2024 09:38:31 +0000 (11:38 +0200)
committerChristoph Hellwig <hch@lst.de>
Tue, 22 Oct 2024 09:38:31 +0000 (11:38 +0200)
commit0338c38ce3f7c448d1e7527890fa6f6724459aff
tree813e7d5c721874d654ddfa14746899aebd322dcb
parentd41d80a9a8fbd8514017cac4d28227df91649969
xfs: fix finding a last resort AG in xfs_filestream_pick_ag

When the main loop in xfs_filestream_pick_ag fails to find a suitable
AG it tries to just pick the online AG.  But the loop for that uses
args->pag as loop iterator while the later code expects pag to be
set.  Fix this by reusing the max_pag case for this last resort, and
also add a check for impossible case of no AG just to make sure that
the uninitialized pag doesn't even escape in theory.

Signed-off-by: Christoph Hellwig <hch@lst.de>
fs/xfs/xfs_filestream.c