[lkml]   [2009]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v2] Fix i_mutex handling in nfsd readdir

"J. Bruce Fields":
> On Thu, Apr 23, 2009 at 04:27:05PM -0400, bfields wrote:
> > On Thu, Apr 23, 2009 at 03:40:23PM +0900, wrote:
> > >
> > > "J. Bruce Fields":
> > > > > Isn't it better to test it BEFORE fh_compose()?
> > > :::
> > > > Yes, I think you're right.
> Err, no, I was confused, the v3 spec does clearly state that the
> filehandle field here is just an optional optimization.
> But now that I look fh_compose() seems perfectly capable of dealing with
> negative dentries, so I don't think your patch is necessary after all.

I agree with you.
I just thought it is _better_ to test it BEFORE fh_compose(). I don't
think fh_compose() would crash.

If you move lookup_one_len() from nfsd4_encode_dirent_fattr() to
nfsd4_encode_dirent(), then I'd suggest you to move dput() too.
Applying your patch,
- when we get a negative dentry, nfsd4_encode_dirent() will return
without dput(). Is it OK?
- when lookup_one_len() returns an error, nfsd4_encode_dirent() may
crash later.

J. R. Okajima

 \ /
  Last update: 2009-05-06 07:13    [W:0.060 / U:3.860 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site