Skip to content

Commit

Permalink
ocfs2: invalidate dentry if its dentry_lock isn't initialized.
Browse files Browse the repository at this point in the history
In commit a5a0a63, when
ocfs2_attch_dentry_lock fails, we call an extra iput and reset
dentry->d_fsdata to NULL. This resolve a bug, but it isn't
completed and the dentry is still there. When we want to use
it again, ocfs2_dentry_revalidate doesn't catch it and return
true. That make future ocfs2_dentry_lock panic out.
One bug is http://oss.oracle.com/bugzilla/show_bug.cgi?id=1162.

The resolution is to add a check for dentry->d_fsdata in
revalidate process and return false if dentry->d_fsdata is NULL,
so that a new ocfs2_lookup will be called again.

Signed-off-by: Tao Ma <tao.ma@oracle.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
  • Loading branch information
Tao Ma authored and Joel Becker committed Aug 28, 2009
1 parent c795b33 commit a1b08e7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions fs/ocfs2/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,17 @@ static int ocfs2_dentry_revalidate(struct dentry *dentry,
goto bail;
}

/*
* If the last lookup failed to create dentry lock, let us
* redo it.
*/
if (!dentry->d_fsdata) {
mlog(0, "Inode %llu doesn't have dentry lock, "
"returning false\n",
(unsigned long long)OCFS2_I(inode)->ip_blkno);
goto bail;
}

ret = 1;

bail:
Expand Down

0 comments on commit a1b08e7

Please sign in to comment.