lkml.org 
[lkml]   [2009]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2] Fix i_mutex handling in nfsd readdir
From
On Wed, Apr 22, 2009 at 01:41:46PM +0900, hooanon05@yahoo.co.jp wrote:
>
> David Woodhouse:
> > This patch fixes it by locking the directory's i_mutex again before
> > calling the filldir functions. The original deadlocks which commit
> :::
>
> An entry may be removed between the first mutex_unlock and the second
> mutex_lock. In this case, lookup_one_len() in compose_entry_fh() will
> return a negative dentry.
> Currently the inode test (positive/negative) is done AFTER fh_compose().
> Isn't it better to test it BEFORE fh_compose()?
>
> compose_entry_fh()
> {
> :::
> dchild = lookup_one_len(name, dparent, namlen);
> if (IS_ERR(dchild))
> return 1;
> if (d_mountpoint(dchild) ||
> fh_compose(fhp, exp, dchild, &cd->fh) != 0 ||
> !dchild->d_inode)
> rv = 1;
> :::
> }

Yes, I think you're right.

Arrrgh.

--b.


\
 
 \ /
  Last update: 2009-04-22 21:17    [W:0.146 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site