[OpenAFS-devel] Issues with my precache patch (was: Documentation for fs precache)

Tom Keiser tkeiser@sinenomine.net
Tue, 19 Oct 2010 13:49:00 -0400


On Tue, Oct 19, 2010 at 1:42 PM, Phillip Moore
<w.phillip.moore@gmail.com> wrote:
> I took a simple first pass this, by simply allowing "precache" to behave
> similar to commands like "bypassthreshold" and "storebehind". =A0 This se=
emed
> like it would be a simple matter of copying the approach used by other
> functions.
> Based on how bypassthreshold is implemented, I tried the function pasted
> below, and it simply doesn't work, and I wonder if the issue is in the co=
de
> that implements the pioctl call (and I can't even find that....)
> The resulting fs binary does two things I don't understand. =A0First, whe=
n no
> argument is given, I expected the pioctl call to set the value of blob.ou=
t,
> but instead I get this error:
> fs: server or network not responding
> If I try to set the value to, say, 100000, then I'm getting a completely
> different value back:
> Precache size 1101949910
> Is this a matter of the pioctl() call not supporting returning the value,
> perhaps? =A0I'm guessing that the error occurs because the pioctl() code =
is
> written to expect an input value, and the strange integer value is just
> random noise, because the same pioctl() code isn't setting the return val=
ue
> in blob.out at all.
> I'm not familiar with how the pioctl code is organized at all. =A0Can som=
eone
> point me to the place that actually handles:
> =A0=A0 =A0code =3D pioctl(0, VIOCPRECACHE, &blob, 1);
> so I can figure this out?

look for DECL_PIOCTL(PPrecache) in src/afs/afs_pioctl.c.

Sure enough, we only do a copyin() [via afs_pd_getInt()]...

-Tom