]> rtime.felk.cvut.cz Git - linux-imx.git/commit
UBIFS: fix shrinker object count reports
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Tue, 31 May 2011 04:03:21 +0000 (07:03 +0300)
committerAndi Kleen <ak@linux.intel.com>
Mon, 1 Aug 2011 20:54:54 +0000 (13:54 -0700)
commit6093240b06916ca21216bb4728f79b264fd08e30
tree5d0ce67fdbd3b64c1be10ae346f7e0fa269eda95
parent6f0a1a45a8ed6c59710605fc763a5d3515a4324a
UBIFS: fix shrinker object count reports

commit cf610bf4199770420629d3bc273494bd27ad6c1d upstream.

Sometimes VM asks the shrinker to return amount of objects it can shrink,
and we return the ubifs_clean_zn_cnt in that case. However, it is possible
that this counter is negative for a short period of time, due to the way
UBIFS TNC code updates it. And I can observe the following warnings sometimes:

shrink_slab: ubifs_shrinker+0x0/0x2b7 [ubifs] negative objects to delete nr=-8541616642706119788

This patch makes sure UBIFS never returns negative count of objects.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
fs/ubifs/shrinker.c