aboutsummaryrefslogtreecommitdiffstats
path: root/net/unix/garbage.c
diff options
context:
space:
mode:
authorDarrick J. Wong <[email protected]>2018-06-22 06:26:56 +0000
committerDarrick J. Wong <[email protected]>2018-06-24 18:56:36 +0000
commitaafe12cee0b132824f5187987f8a3fb704b9f685 (patch)
treeb8a63a10619de108ad967af566a1846de4f0bf42 /net/unix/garbage.c
parentxfs: allow empty transactions while frozen (diff)
downloadkernel-aafe12cee0b132824f5187987f8a3fb704b9f685.tar.gz
kernel-aafe12cee0b132824f5187987f8a3fb704b9f685.zip
xfs: don't trip over negative free space in xfs_reserve_blocks
If we somehow end up with a filesystem that has fewer free blocks than the blocks set aside to avoid ENOSPC deadlocks, it's possible that the free space calculation in xfs_reserve_blocks will spit out a negative number (because percpu_counter_sum returns s64). We fail to notice this negative number and set fdblks_delta to it. Now we increment fdblocks(!) and the unsigned type of m_resblks means that we end up setting a ridiculously huge m_resblks reservation. Avoid this comedy of errors by detecting the negative free space and returning -ENOSPC. Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Allison Henderson <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
Diffstat (limited to 'net/unix/garbage.c')
0 files changed, 0 insertions, 0 deletions