mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-11-17 10:01:01 +03:00
Fix 'arc_c < arc_c_min' panic
Strictly enforce keeping 'arc_c >= arc_c_min'. The ASSERTs are left in place to catch this in a debug build but logic has been added to gracefully handle in a production build. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Issue #3904
This commit is contained in:
parent
8f90f7372a
commit
935434ef01
@ -3757,7 +3757,8 @@ arc_adapt(int bytes, arc_state_t *state)
|
||||
* If we're within (2 * maxblocksize) bytes of the target
|
||||
* cache size, increment the target cache size
|
||||
*/
|
||||
VERIFY3U(arc_c, >=, 2ULL << SPA_MAXBLOCKSHIFT);
|
||||
ASSERT3U(arc_c, >=, 2ULL << SPA_MAXBLOCKSHIFT);
|
||||
arc_c = MAX(arc_c, 2ULL << SPA_MAXBLOCKSHIFT);
|
||||
if (arc_size >= arc_c - (2ULL << SPA_MAXBLOCKSHIFT)) {
|
||||
atomic_add_64(&arc_c, (int64_t)bytes);
|
||||
if (arc_c > arc_c_max)
|
||||
|
Loading…
Reference in New Issue
Block a user