This is a note to let you know that I've just added the patch titled

    UBIFS: fix shrinker object count reports

to the 2.6.39-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     ubifs-fix-shrinker-object-count-reports.patch
and it can be found in the queue-2.6.39 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From cf610bf4199770420629d3bc273494bd27ad6c1d Mon Sep 17 00:00:00 2001
From: Artem Bityutskiy <[email protected]>
Date: Tue, 31 May 2011 07:03:21 +0300
Subject: UBIFS: fix shrinker object count reports

From: Artem Bityutskiy <[email protected]>

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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 fs/ubifs/shrinker.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- a/fs/ubifs/shrinker.c
+++ b/fs/ubifs/shrinker.c
@@ -283,7 +283,11 @@ int ubifs_shrinker(struct shrinker *shri
        long clean_zn_cnt = atomic_long_read(&ubifs_clean_zn_cnt);
 
        if (nr == 0)
-               return clean_zn_cnt;
+               /*
+                * Due to the way UBIFS updates the clean znode counter it may
+                * temporarily be negative.
+                */
+               return clean_zn_cnt >= 0 ? clean_zn_cnt : 1;
 
        if (!clean_zn_cnt) {
                /*


Patches currently in stable-queue which might be from 
[email protected] are

queue-2.6.39/ubifs-fix-memory-leak-on-error-path.patch
queue-2.6.39/ubifs-fix-shrinker-object-count-reports.patch

_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to