ocfs2/dlm: get mle inuse only when it is initialized
PATCH v2 1/1 ocfs2/dlm: get mle inuse only when it is initialized
Sorry for previous patch's format.
So I resend it.
When dlm_add_migration_mle returns -EEXIST, previously input mle will not be initialized. So we can't use its associated dlm object. And we truly don't need this mle for already launched migration progress, since oldmle has taken this role.
Thanks,
Changwei
--- fs/ocfs2/dlm/dlmmaster.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/ocfs2/dlm/dlmmaster.c +3 -1
@@ -2616,7 +2616,9 @@ static int dlm_migrate_lockres(struct dlm_ctxt *dlm,* otherwise the assert_master from the new * master will destroy this. */ -dlm_get_mle_inuse (mle); +if (ret != -EEXIST ) +dlm_get_mle_inuse (mle); +spin_unlock (&dlm->master_lock);spin_unlock (&dlm->spinlock);
Signature · 1 line
2.11.0
PATCH v2 1/1 ocfs2/dlm: get mle inuse only when it is initialized
Hi Changwei,
Now, this seem a good fix. But it would be better if you can add a *Fixs* tag. BTW, I think this problem also exists in the "-stable" tree and you may cc <[email protected]>.
Thanks,
Alex
Quoted 31 lines · Changwei Ge
Sorry for previous patch's format.
So I resend it.When
dlm_add_migration_mlereturns-EEXIST, previously input mle will not be initialized. So we can't use its associated dlm object. And we truly don't need this mle for already launched migration progress, since oldmle has taken this role.Thanks,
ChangweiSigned-off-by Changwei Ge <[email protected]>--- fs/ocfs2/dlm/dlmmaster.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)fs/ocfs2/dlm/dlmmaster.c +3
-1@@ -2616,7 +2616,9 @@ static int dlm_migrate_lockres(struct dlm_ctxt *dlm,* otherwise the assert_master from the new * master will destroy this. */ -dlm_get_mle_inuse (mle); +if (ret != -EEXIST ) +dlm_get_mle_inuse (mle); +spin_unlock (&dlm->master_lock);spin_unlock (&dlm->spinlock);
PATCH v2 1/1 ocfs2/dlm: get mle inuse only when it is initialized
In reply to Changwei GeQuoted 8 lines · Changwei Ge
Sorry for previous patch's format.
So I resend it.When
dlm_add_migration_mlereturns-EEXIST, previously input mle will not be initialized. So we can't use its associated dlm object. And we truly don't need this mle for already launched migration progress, since oldmle has taken this role.
Quoted 4 lines
Thanks,
ChangweiSigned-off-by Changwei Ge <[email protected]>
Quoted 19 lines
--- fs/ocfs2/dlm/dlmmaster.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)fs/ocfs2/dlm/dlmmaster.c +3
-1@@ -2616,7 +2616,9 @@ static int dlm_migrate_lockres(struct dlm_ctxt *dlm,* otherwise the assert_master from the new * master will destroy this. */ -dlm_get_mle_inuse (mle); +if (ret != -EEXIST ) +dlm_get_mle_inuse (mle); +spin_unlock (&dlm->master_lock);spin_unlock (&dlm->spinlock);