UBIFS: fix shrinker object count reports
commit439aa7dfce5dd2afdc2a9d669d0b147f1a9d8f4f
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Tue, 31 May 2011 04:03:21 +0000 (31 07:03 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 23 Jun 2011 22:24:05 +0000 (23 15:24 -0700)
treec0c605c4d37c1750d3795f3d184150c42e00a3ce
parent8b75b31813ea2929108ab0bf963feb9459f16992
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>
fs/ubifs/shrinker.c