summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_ioctl.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2021-05-20 17:15:49 -0700
committerDarrick J. Wong <djwong@kernel.org>2021-05-24 18:01:04 -0700
commit0f9342513cc78a31a4a272a19b35eee4e8cd7107 (patch)
tree68f4264e73665ec9ca626a3d67a5e8d3594360b3 /fs/xfs/xfs_ioctl.c
parente3c2b047475b52739bcf178a9e95176c42bbcf8f (diff)
xfs: check free AG space when making per-AG reservations
The new online shrink code exposed a gap in the per-AG reservation code, which is that we only return ENOSPC to callers if the entire fs doesn't have enough free blocks. Except for debugging mode, the reservation init code doesn't ever check that there's enough free space in that AG to cover the reservation. Not having enough space is not considered an immediate fatal error that requires filesystem offlining because (a) it's shouldn't be possible to wind up in that state through normal file operations and (b) even if one did, freeing data blocks would recover the situation. However, online shrink now needs to know if shrinking would not leave enough space so that it can abort the shrink operation. Hence we need to promote this assertion into an actual error return. Observed by running xfs/168 with a 1k block size, though in theory this could happen with any configuration. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com> Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Diffstat (limited to 'fs/xfs/xfs_ioctl.c')
0 files changed, 0 insertions, 0 deletions