ocfs2: invalidate dentry if its dentry_lock isn't initialized.
PATCH 1/1 ocfs2: invalidate dentry if its dentry_lock isn't initialized.
In commit a5a0a630922a2f6a774b6dac19f70cb5abd86bb0, 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.
--- fs/ocfs2/dcache.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)
fs/ocfs2/dcache.c +11 -0
@@ -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:
Signature · 1 line
1.5.5
PATCH 1/1 ocfs2: invalidate dentry if its dentry_lock isn't initialized.
Quoted 8 lines · Tao Ma
In commit
a5a0a630922a2f6a774b6dac19f70cb5abd86bb0, whenocfs2_attch_dentry_lockfails, we call an extra iput and resetdentry->d_fsdatato 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_revalidatedoesn't catch it and return true. That make futureocfs2_dentry_lockpanic out. One bug is http://oss.oracle.com/bugzilla/show_bug.cgi?id=1162.
Quoted 5 lines
The resolution is to add a check for
dentry->d_fsdatain revalidate process and return false ifdentry->d_fsdatais NULL, so that a newocfs2_lookupwill be called again.Signed-off-by Tao Ma <[email protected]>
This is now in the fixes branch of ocfs2.git.
Joel
Signature · 10 lines
"Lately I've been talking in my sleep. Can't imagine what I'd have to say. Except my world will be right When love comes back my way." Joel Becker Principal Software Developer Oracle E-mail: joel.becker at oracle.com Phone: (650) 506-8127
PATCH 1/1 ocfs2: invalidate dentry if its dentry_lock isn't initialized.
In reply to Tao MaQuoted 40 lines · Tao Ma
In commit
a5a0a630922a2f6a774b6dac19f70cb5abd86bb0, whenocfs2_attch_dentry_lockfails, we call an extra iput and resetdentry->d_fsdatato 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_revalidatedoesn't catch it and return true. That make futureocfs2_dentry_lockpanic out. One bug is http://oss.oracle.com/bugzilla/show_bug.cgi?id=1162.The resolution is to add a check for
dentry->d_fsdatain revalidate process and return false ifdentry->d_fsdatais NULL, so that a newocfs2_lookupwill be called again.Signed-off-by Tao Ma <[email protected]>--- fs/ocfs2/dcache.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)fs/ocfs2/dcache.c +11
-0@@ -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: