Question regarding CIFS cache=loose behavior.
Jeffrey Layton
jlayton at redhat.com
Wed Mar 26 08:12:19 MDT 2014
On Wed, 26 Mar 2014 23:05:20 +0900
Tetsuo Handa <penguin-kernel at I-love.SAKURA.ne.jp> wrote:
> Jeffrey Layton wrote:
> > > ...or that samba is omitting it and is sending cached info
> > > instead of doing the lstat() call? I'm not sure if it does that,
> > > but I don't think you should draw too many conclusions about the
> > > behavior of cifs.ko from stracing smbd.
> > >
> > > What may make more sense is to get network captures and analyze
> > > the behavior from that perspective.
> > >
> >
> > ...or maybe it *is* cifs.ko. From cifs_inode_needs_reval:
> >
> >
> > if (!time_in_range(jiffies, cifs_i->time,
> > cifs_i->time + cifs_sb->actimeo))
> > return true;
> >
> >
> > ...I think though that if cifs_i->time == jiffies and actimeo=0,
> > then that condition will be false. As a quick check, it might be
> > good to add something like this before that if statement and then
> > rerun your test:
> >
> > if (!cifs_sb->actimeo)
> > return true;
> >
> > That should get rid of that particular corner case.
>
> Yes, I confirmed that below change fixes this problem. Thank you.
>
> --- a/fs/cifs/inode.c
> +++ b/fs/cifs/inode.c
> @@ -1737,6 +1737,8 @@ cifs_inode_needs_reval(struct inode *inode)
> if (cifs_i->time == 0)
> return true;
>
> + if (!cifs_sb->actimeo)
> + return true;
> if (!time_in_range(jiffies, cifs_i->time,
> cifs_i->time + cifs_sb->actimeo))
> return true;
Great, thanks for testing it. I'll send Steve a patch for 3.15 and cc
you.
--
Jeff Layton <jlayton at redhat.com>
More information about the samba-technical
mailing list