Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: [PATCH] Optimisation for readdir using fstatat.

2 views
Skip to first unread message

Jeremy Allison

unread,
May 24, 2013, 4:37:35 PM5/24/13
to
On Fri, May 24, 2013 at 01:31:17PM -0700, Jeremy Allison wrote:
> On Fri, May 24, 2013 at 01:23:20PM -0700, Jeremy Allison wrote:
> > On Fri, May 24, 2013 at 04:19:59PM -0400, Ira Cooper wrote:
> > > A concern raised by Richard, which I haven't had the chance to look at... Is
> > > the use of "stat" here premature?
> >
> > No.
> >
> > > (For every readdir, are we guaranteed to stat, and not lstat etc...)
> >
> > If we pass in a SMB_STRUCT_STAT *sbuf then yes, we are
> > guaranteed to stat(). If it's a POSIX path then we will
> > ignore the reply from readdir() here and re-stat using
> > lstat() on top (see the comment in the patch). I checked
> > out all codepaths before adding this.
>
> If you're really worried about this I can add a:
>
> int flags = (lp_posix_pathnames() ? AT_SYMLINK_NOFOLLOW : 0);
>
> arg to the fstatat() call just to make sure we can't
> mess up here.

Updated for taste :-). Bless whichever version you're
happy with :-).

Jeremy.
fstatat-optimization.patchset
0 new messages