All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sunil Mushran <sunil.mushran@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 1/1] ocfs2: return -EAGAIN instead of EAGAIN in dlm
Date: Fri, 20 Nov 2009 17:25:29 -0800	[thread overview]
Message-ID: <4B074189.2050108@oracle.com> (raw)
In-Reply-To: <1258597066-9227-1-git-send-email-tiger.yang@oracle.com>

ack

Tiger Yang wrote:
> We used to return positive EAGAIN to indicate a retry action
> is needed in dlm_begin_reco_handler(). Now we return negative
> -EAGAIN to erase the confusion caused by this error code.
>
> Signed-off-by: Tiger Yang <tiger.yang@oracle.com>
> ---
>  fs/ocfs2/dlm/dlmrecovery.c |   18 +++++++++---------
>  1 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c
> index d9fa3d2..2f9e4e1 100644
> --- a/fs/ocfs2/dlm/dlmrecovery.c
> +++ b/fs/ocfs2/dlm/dlmrecovery.c
> @@ -2589,6 +2589,14 @@ retry:
>  			     "begin reco msg (%d)\n", dlm->name, nodenum, ret);
>  			ret = 0;
>  		}
> +		if (ret == -EAGAIN) {
> +			mlog(0, "%s: trying to start recovery of node "
> +			     "%u, but node %u is waiting for last recovery "
> +			     "to complete, backoff for a bit\n", dlm->name,
> +			     dead_node, nodenum);
> +			msleep(100);
> +			goto retry;
> +		}
>  		if (ret < 0) {
>  			struct dlm_lock_resource *res;
>  			/* this is now a serious problem, possibly ENOMEM 
> @@ -2608,14 +2616,6 @@ retry:
>  			 * another ENOMEM */
>  			msleep(100);
>  			goto retry;
> -		} else if (ret == EAGAIN) {
> -			mlog(0, "%s: trying to start recovery of node "
> -			     "%u, but node %u is waiting for last recovery "
> -			     "to complete, backoff for a bit\n", dlm->name,
> -			     dead_node, nodenum);
> -			/* TODO Look into replacing msleep with cond_resched() */
> -			msleep(100);
> -			goto retry;
>  		}
>  	}
>  
> @@ -2639,7 +2639,7 @@ int dlm_begin_reco_handler(struct o2net_msg *msg, u32 len, void *data,
>  		     dlm->name, br->node_idx, br->dead_node,
>  		     dlm->reco.dead_node, dlm->reco.new_master);
>  		spin_unlock(&dlm->spinlock);
> -		return EAGAIN;
> +		return -EAGAIN;
>  	}
>  	spin_unlock(&dlm->spinlock);
>  
>   

  reply	other threads:[~2009-11-21  1:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-18 10:35 [Ocfs2-devel] [PATCH 1/1] ocfs2: return -EAGAIN instead of EAGAIN in dlm Tiger Yang
2009-11-18 22:26 ` Sunil Mushran
2009-11-19  2:17   ` Tiger Yang
2009-11-21  1:25     ` Sunil Mushran [this message]
2009-12-03  1:38     ` Joel Becker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B074189.2050108@oracle.com \
    --to=sunil.mushran@oracle.com \
    --cc=ocfs2-devel@oss.oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.