]> granicus.if.org Git - zfs/commitdiff
Correct signed operation
authorDebabrata Banerjee <dbanerje@akamai.com>
Thu, 16 Mar 2017 01:01:31 +0000 (21:01 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 2 May 2017 19:50:26 +0000 (15:50 -0400)
Could return the wrong pages value

AKAMAI: zfs: CR 3695072
Reviewed-by: Tim Chase <tim@chase2k.com>
Reviewed-by: Richard Yao <ryao@gentoo.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Debabrata Banerjee <dbanerje@akamai.com>
Issue #6035

module/zfs/arc.c

index efac973bae6822131b332f69aaa4964e4834104d..ce9246061639e07496ad638e3fc006503311a553 100644 (file)
@@ -4430,7 +4430,8 @@ __arc_shrinker_func(struct shrinker *shrink, struct shrink_control *sc)
                if (current_is_kswapd())
                        arc_kmem_reap_now();
 #ifdef HAVE_SPLIT_SHRINKER_CALLBACK
-               pages = MAX(pages - btop(arc_evictable_memory()), 0);
+               pages = MAX((int64_t)pages -
+                   (int64_t)btop(arc_evictable_memory()), 0);
 #else
                pages = btop(arc_evictable_memory());
 #endif
@@ -4438,7 +4439,6 @@ __arc_shrinker_func(struct shrinker *shrink, struct shrink_control *sc)
                 * We've shrunk what we can, wake up threads.
                 */
                cv_broadcast(&arc_reclaim_waiters_cv);
-
        } else
                pages = SHRINK_STOP;