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

Phillip Moore w.phillip.moore@gmail.com
Tue, 19 Oct 2010 14:02:06 -0400


--20cf300fb2f5476c7a0492fc1739
Content-Type: text/plain; charset=ISO-8859-1

That means I will need a new kernel module installed in order to test this,
doesn't it?

Is there anything I need to worry about if I change
 DECL_PIOCTL(PPrecache) to behave more
like DECL_PIOCTL(PSetCachingThreshold)?

The change seems pretty obvious, but this is the first time (OK, in about 13
years) that I've touched any of the code in the kernel module.

On Tue, Oct 19, 2010 at 1:49 PM, Tom Keiser <tkeiser@sinenomine.net> wrote:

> 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".   This
> seemed
> > 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
> code
> > that implements the pioctl call (and I can't even find that....)
> > The resulting fs binary does two things I don't understand.  First, when
> no
> > argument is given, I expected the pioctl call to set the value of
> blob.out,
> > 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?  I'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
> value
> > in blob.out at all.
> > I'm not familiar with how the pioctl code is organized at all.  Can
> someone
> > point me to the place that actually handles:
> >     code = 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
>

--20cf300fb2f5476c7a0492fc1739
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div><br></div>That means I will need a new kernel module installed in orde=
r to test this, doesn&#39;t it?<div><br></div><div>Is there anything I need=
 to worry about if I change =A0DECL_PIOCTL(PPrecache)=A0to behave more like=
=A0DECL_PIOCTL(PSetCachingThreshold)?</div>
<div><br></div><div>The change seems pretty obvious, but this is the first =
time (OK, in about 13 years) that I&#39;ve touched any of the code in the k=
ernel module. =A0</div><div><br><div class=3D"gmail_quote">On Tue, Oct 19, =
2010 at 1:49 PM, Tom Keiser <span dir=3D"ltr">&lt;<a href=3D"mailto:tkeiser=
@sinenomine.net">tkeiser@sinenomine.net</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex;">On Tue, Oct 19, 2010 at 1:42 PM, Phillip Mo=
ore<br>
<div class=3D"im">&lt;<a href=3D"mailto:w.phillip.moore@gmail.com">w.philli=
p.moore@gmail.com</a>&gt; wrote:<br>
</div><div><div></div><div class=3D"h5">&gt; I took a simple first pass thi=
s, by simply allowing &quot;precache&quot; to behave<br>
&gt; similar to commands like &quot;bypassthreshold&quot; and &quot;storebe=
hind&quot;. =A0 This seemed<br>
&gt; like it would be a simple matter of copying the approach used by other=
<br>
&gt; functions.<br>
&gt; Based on how bypassthreshold is implemented, I tried the function past=
ed<br>
&gt; below, and it simply doesn&#39;t work, and I wonder if the issue is in=
 the code<br>
&gt; that implements the pioctl call (and I can&#39;t even find that....)<b=
r>
&gt; The resulting fs binary does two things I don&#39;t understand. =A0Fir=
st, when no<br>
&gt; argument is given, I expected the pioctl call to set the value of blob=
.out,<br>
&gt; but instead I get this error:<br>
&gt; fs: server or network not responding<br>
&gt; If I try to set the value to, say, 100000, then I&#39;m getting a comp=
letely<br>
&gt; different value back:<br>
&gt; Precache size 1101949910<br>
&gt; Is this a matter of the pioctl() call not supporting returning the val=
ue,<br>
&gt; perhaps? =A0I&#39;m guessing that the error occurs because the pioctl(=
) code is<br>
&gt; written to expect an input value, and the strange integer value is jus=
t<br>
&gt; random noise, because the same pioctl() code isn&#39;t setting the ret=
urn value<br>
&gt; in blob.out at all.<br>
&gt; I&#39;m not familiar with how the pioctl code is organized at all. =A0=
Can someone<br>
&gt; point me to the place that actually handles:<br>
&gt; =A0=A0 =A0code =3D pioctl(0, VIOCPRECACHE, &amp;blob, 1);<br>
&gt; so I can figure this out?<br>
<br>
</div></div>look for DECL_PIOCTL(PPrecache) in src/afs/afs_pioctl.c.<br>
<br>
Sure enough, we only do a copyin() [via afs_pd_getInt()]...<br>
<font color=3D"#888888"><br>
-Tom<br>
</font></blockquote></div><br></div>

--20cf300fb2f5476c7a0492fc1739--