* [Ocfs2-devel] [PATCH] ocfs2: invalidate dentry if its dentry_lock isn't initialized.
@ 2009-08-27 6:46 Tao Ma
2009-08-28 1:17 ` Joel Becker
2009-09-01 17:47 ` Sunil Mushran
0 siblings, 2 replies; 3+ messages in thread
From: Tao Ma @ 2009-08-27 6:46 UTC (permalink / raw)
To: ocfs2-devel
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.
Signed-off-by: Tao Ma <tao.ma@oracle.com>
---
fs/ocfs2/dcache.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/fs/ocfs2/dcache.c b/fs/ocfs2/dcache.c
index 2f28b7d..b4957c7 100644
--- a/fs/ocfs2/dcache.c
+++ b/fs/ocfs2/dcache.c
@@ -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:
--
1.5.5
^ permalink raw reply related [flat|nested] 3+ messages in thread* [Ocfs2-devel] [PATCH] ocfs2: invalidate dentry if its dentry_lock isn't initialized.
2009-08-27 6:46 [Ocfs2-devel] [PATCH] ocfs2: invalidate dentry if its dentry_lock isn't initialized Tao Ma
@ 2009-08-28 1:17 ` Joel Becker
2009-09-01 17:47 ` Sunil Mushran
1 sibling, 0 replies; 3+ messages in thread
From: Joel Becker @ 2009-08-28 1:17 UTC (permalink / raw)
To: ocfs2-devel
On Thu, Aug 27, 2009 at 02:46:56PM +0800, Tao Ma wrote:
> 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.
>
> Signed-off-by: Tao Ma <tao.ma@oracle.com>
This is now in the fixes branch of ocfs2.git.
Joel
--
"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
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Ocfs2-devel] [PATCH] ocfs2: invalidate dentry if its dentry_lock isn't initialized.
2009-08-27 6:46 [Ocfs2-devel] [PATCH] ocfs2: invalidate dentry if its dentry_lock isn't initialized Tao Ma
2009-08-28 1:17 ` Joel Becker
@ 2009-09-01 17:47 ` Sunil Mushran
1 sibling, 0 replies; 3+ messages in thread
From: Sunil Mushran @ 2009-09-01 17:47 UTC (permalink / raw)
To: ocfs2-devel
Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Tao Ma wrote:
> 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.
>
> Signed-off-by: Tao Ma <tao.ma@oracle.com>
> ---
> fs/ocfs2/dcache.c | 11 +++++++++++
> 1 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/fs/ocfs2/dcache.c b/fs/ocfs2/dcache.c
> index 2f28b7d..b4957c7 100644
> --- a/fs/ocfs2/dcache.c
> +++ b/fs/ocfs2/dcache.c
> @@ -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:
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-09-01 17:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-27 6:46 [Ocfs2-devel] [PATCH] ocfs2: invalidate dentry if its dentry_lock isn't initialized Tao Ma
2009-08-28 1:17 ` Joel Becker
2009-09-01 17:47 ` Sunil Mushran
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.