diff --git a/[refs] b/[refs] index 6cde9f8d894f..78cde970035c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 376be5ff8a6a36efadd131860cf26841f366d44c +refs/heads/master: 8cfd14ad1eb52e44cb1fe7b47a68126e45e04026 diff --git a/trunk/include/linux/res_counter.h b/trunk/include/linux/res_counter.h index c9d625ca659e..d06d014afda6 100644 --- a/trunk/include/linux/res_counter.h +++ b/trunk/include/linux/res_counter.h @@ -142,7 +142,10 @@ static inline unsigned long long res_counter_margin(struct res_counter *cnt) unsigned long flags; spin_lock_irqsave(&cnt->lock, flags); - margin = cnt->limit - cnt->usage; + if (cnt->limit > cnt->usage) + margin = cnt->limit - cnt->usage; + else + margin = 0; spin_unlock_irqrestore(&cnt->lock, flags); return margin; }