]> git.michaelhowe.org Git - packages/o/openafs.git/commit
afs: fs getcacheparms miscounts dcaches for large files
authorMark Vitale <mvitale@sinenomine.net>
Tue, 12 Jan 2016 23:06:51 +0000 (18:06 -0500)
committerStephan Wiesand <stephan.wiesand@desy.de>
Wed, 26 Apr 2017 15:02:07 +0000 (11:02 -0400)
commitfb7eceb7606c91d9cd8b3ce196a81c110c58a3be
tree82120172e2014b5f5256f912fa5b0b2f61a2a4ff
parentbf222ca6ae9a36d246a0431b0244871637080a25
afs: fs getcacheparms miscounts dcaches for large files

fs getcacheparms issued with the -excessive option tabulates in-memory
dcaches ("DCentries") by size.  However, any dcache with validPos > 2^31
is miscounted in the 4k-16k bucket.  This is caused by a type mismatch
between 'validPos' (afs_size_t) and 'size' (int) which leads to a
negative value for size by sign-extension.  The size comparison "sieve"
fails for negative numbers; it skips the first bucket (0-4K) and dumps
them in the second one (4k-16k).

Move the declaration of 'size' closer to its use, and declare it with
the same type as 'validPos' (afs_size_t) so the comparison sieve
correctly places these dcaches in the last (>=1M) bucket.

Reviewed-on: https://gerrit.openafs.org/12347
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit b5e4e8c14130f601bbf43dee5927222ebf7613fa)

Change-Id: I659fd86f05b29c1eac1a262d340bcc1ce2640797
Reviewed-on: https://gerrit.openafs.org/12605
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/afs/afs_pioctl.c