All of lore.kernel.org
 help / color / mirror / Atom feed
* [Ocfs2-devel] [PATCH v2] ocfs2/dlm: get mle inuse only when it is initialized
@ 2017-11-14  9:15 Changwei Ge
  2017-11-14  9:22 ` alex chen
  2017-11-14 10:44 ` Joseph Qi
  0 siblings, 2 replies; 3+ messages in thread
From: Changwei Ge @ 2017-11-14  9:15 UTC (permalink / raw)
  To: ocfs2-devel

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

Signed-off-by: Changwei Ge <ge.changwei@h3c.com>
---
  fs/ocfs2/dlm/dlmmaster.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
index 3e04279446e8..9c3e0f13ca87 100644
--- a/fs/ocfs2/dlm/dlmmaster.c
+++ b/fs/ocfs2/dlm/dlmmaster.c
@@ -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);

-- 
2.11.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Ocfs2-devel] [PATCH v2] ocfs2/dlm: get mle inuse only when it is initialized
  2017-11-14  9:15 [Ocfs2-devel] [PATCH v2] ocfs2/dlm: get mle inuse only when it is initialized Changwei Ge
@ 2017-11-14  9:22 ` alex chen
  2017-11-14 10:44 ` Joseph Qi
  1 sibling, 0 replies; 3+ messages in thread
From: alex chen @ 2017-11-14  9:22 UTC (permalink / raw)
  To: ocfs2-devel

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 <stable@vger.kernel.org>.

Thanks,
Alex

On 2017/11/14 17:15, Changwei Ge wrote:
> 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
> 
> Signed-off-by: Changwei Ge <ge.changwei@h3c.com>
> ---
>   fs/ocfs2/dlm/dlmmaster.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
> index 3e04279446e8..9c3e0f13ca87 100644
> --- a/fs/ocfs2/dlm/dlmmaster.c
> +++ b/fs/ocfs2/dlm/dlmmaster.c
> @@ -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);
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Ocfs2-devel] [PATCH v2] ocfs2/dlm: get mle inuse only when it is initialized
  2017-11-14  9:15 [Ocfs2-devel] [PATCH v2] ocfs2/dlm: get mle inuse only when it is initialized Changwei Ge
  2017-11-14  9:22 ` alex chen
@ 2017-11-14 10:44 ` Joseph Qi
  1 sibling, 0 replies; 3+ messages in thread
From: Joseph Qi @ 2017-11-14 10:44 UTC (permalink / raw)
  To: ocfs2-devel



On 17/11/14 17:15, Changwei Ge wrote:
> 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
> 
> Signed-off-by: Changwei Ge <ge.changwei@h3c.com>
Reviewed-by: Joseph Qi <jiangqi903@gmail.com>

> ---
>   fs/ocfs2/dlm/dlmmaster.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
> index 3e04279446e8..9c3e0f13ca87 100644
> --- a/fs/ocfs2/dlm/dlmmaster.c
> +++ b/fs/ocfs2/dlm/dlmmaster.c
> @@ -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);
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-11-14 10:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-14  9:15 [Ocfs2-devel] [PATCH v2] ocfs2/dlm: get mle inuse only when it is initialized Changwei Ge
2017-11-14  9:22 ` alex chen
2017-11-14 10:44 ` Joseph Qi

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.