Skip to content

Commit

Permalink
Fix 'arc_c < arc_c_min' panic
Browse files Browse the repository at this point in the history
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 <[email protected]>
Issue openzfs#3904
  • Loading branch information
behlendorf committed Oct 13, 2015
1 parent 8f90f73 commit 935434e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion module/zfs/arc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 935434e

Please sign in to comment.