Re: Fix knfsd readahead cache in 2.4.15

David S. Miller (davem@redhat.com)
Mon, 26 Nov 2001 15:53:47 -0800 (PST)


From: Neil Brown <neilb@cse.unsw.edu.au>
Date: Tue, 27 Nov 2001 10:35:26 +1100 (EST)

This is definately a bug, but I don't think it is quite as dramatic as
you suggest.

The "struct raparms" that ra points to will almost always be the last
one on the list, so ra->p_next will almost always be NULL anyway.
Nevertheless, it is a bug and your fix looks good.

There are other problems remaining, this function is a logical
mess.

1) depth is computed in the loop, but thrown away.
It is basically reassigned to a constant before
being used to index the statistics it is for.

2) raparm_cache is reassigned, and since the ra param list is
NULL terminated this can make the list shorter and shorter
and shorter until it is one entry deep.

Yikes :)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/