From bf222ca6ae9a36d246a0431b0244871637080a25 Mon Sep 17 00:00:00 2001 From: Mark Vitale Date: Tue, 12 Jan 2016 17:50:36 -0500 Subject: [PATCH] afs: fs getcacheparms miscounts zero-length dcaches When fs getcacheparms is issued with the -excessive option, it tabulates all in-memory dcaches ("DCentries") by size. dcaches with validPos == 0 were being tabulated in the 4k-16k bucket. Fix the first comparison in the 'sieve' so these dcaches will be counted in the correct 0-4k bucket instead. Introduced by commit 176c2fddb95ced6c13e04e7492fc09b5551f273c Reviewed-on: https://gerrit.openafs.org/12346 Reviewed-by: Stephan Wiesand Reviewed-by: Benjamin Kaduk Tested-by: BuildBot (cherry picked from commit c966c0b8414ef0a041b1a8d5261c9eccd4d39d99) Change-Id: I53a20644f549550cef85f0cc6f3551ed5dbe1e23 Reviewed-on: https://gerrit.openafs.org/12604 Reviewed-by: Mark Vitale Tested-by: BuildBot Reviewed-by: Stephan Wiesand --- src/afs/afs_pioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/afs/afs_pioctl.c b/src/afs/afs_pioctl.c index 8146af9bc..0afdd62cc 100644 --- a/src/afs/afs_pioctl.c +++ b/src/afs/afs_pioctl.c @@ -2913,7 +2913,7 @@ DECL_PIOCTL(PGetCacheSize) if (tdc){ results[9]++; size = tdc->validPos; - if ( 0 < size && size < (1<<12) ) results[10]++; + if ( 0 <= size && size < (1<<12) ) results[10]++; else if (size < (1<<14) ) results[11]++; else if (size < (1<<16) ) results[12]++; else if (size < (1<<18) ) results[13]++; -- 2.39.5