Commit 12ef830
xfs: don't rely on ->total in xfs_alloc_space_available
->total is a bit of an odd parameter passed down to the low-level
allocator all the way from the high-level callers. It's supposed to
contain the maximum number of blocks to be allocated for the whole
transaction [1].
But in xfs_iomap_write_allocate we only convert existing delayed
allocations and thus only have a minimal block reservation for the
current transaction, so xfs_alloc_space_available can't use it for
the allocation decisions. Use the maximum of args->total and the
calculated block requirement to make a decision. We probably should
get rid of args->total eventually and instead apply ->minleft more
broadly, but that will require some extensive changes all over.
[1] which creates lots of confusion as most callers don't decrement it
once doing a first allocation. But that's for a separate series.
Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Brian Foster <[email protected]>
Signed-off-by: Darrick J. Wong <[email protected]>1 parent 54fee13 commit 12ef830
1 file changed
+4
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1995 | 1995 | | |
1996 | 1996 | | |
1997 | 1997 | | |
1998 | | - | |
| 1998 | + | |
1999 | 1999 | | |
2000 | 2000 | | |
2001 | 2001 | | |
| |||
2005 | 2005 | | |
2006 | 2006 | | |
2007 | 2007 | | |
| 2008 | + | |
2008 | 2009 | | |
2009 | 2010 | | |
2010 | | - | |
| 2011 | + | |
2011 | 2012 | | |
2012 | 2013 | | |
2013 | 2014 | | |
2014 | 2015 | | |
2015 | 2016 | | |
2016 | | - | |
| 2017 | + | |
2017 | 2018 | | |
2018 | 2019 | | |
2019 | 2020 | | |
| |||
0 commit comments