Fix knfsd readahead cache in 2.4.15

Trond Myklebust
2001-11-26T13:55:23Z

Hi Neil,

The following patch fixes a bug in the knfsd readahead code. The
memset() that is referenced in the patch below is clobbering the
pointer to the next list element (ra->p_next), thus reducing the inode
readahead cache to 1 entry upon the very first call to
nfsd_get_raparms().

BTW: looking at the choice of cache size. Why is this set to number
of threads * 2? Isn't it better to have a minimum cache size? After
all, the fact that I have 8 threads running does not at all reflect
the number of inodes that I might have open on my various clients...

Cheers,
Trond

--- linux-2.4.16-pre1/fs/nfsd/vfs.c.orig Fri Oct 5 21:23:53 2001
+++ linux-2.4.16-pre1/fs/nfsd/vfs.c Mon Nov 26 14:32:09 2001
@@ -560,9 +560,13 @@
return NULL;
rap = frap;
ra = *frap;
- memset(ra, 0, sizeof(*ra));
ra->p_dev = dev;
ra->p_ino = ino;
+ ra->p_reada = 0;
+ ra->p_ramax = 0;
+ ra->p_raend = 0;
+ ra->p_ralen = 0;
+ ra->p_rawin = 0;
found:
if (rap != &raparm_cache) {
*rap = ra->p_next;