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

Re: [PATCH] Optimisation for readdir using fstatat.

1 view
Skip to first unread message

Jeremy Allison

unread,
May 24, 2013, 4:31:17 PM5/24/13
to
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.

Jeremy

0 new messages