From: Miklos Szeredi Date: Mon, 9 Feb 2009 17:30:43 +0000 (-0500) Subject: lockd: clean up blocking lock cases of nlsmvc_lock() X-Git-Tag: v2.6.30-rc1~183^2~70 X-Git-Url: http://ftp.safe.ca/?p=safe%2Fjmp%2Flinux-2.6;a=commitdiff_plain;h=e33d1ea60c3a17b8b5c2910b1eef4c1faf0ac450 lockd: clean up blocking lock cases of nlsmvc_lock() No change in behavior, just rearranging the switch so that we break out of the switch if and only if we're in the wait case. Signed-off-by: Miklos Szeredi Signed-off-by: J. Bruce Fields --- diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c index 763b78a..83ee342 100644 --- a/fs/lockd/svclock.c +++ b/fs/lockd/svclock.c @@ -426,8 +426,15 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file, ret = nlm_granted; goto out; case -EAGAIN: + /* + * If this is a blocking request for an + * already pending lock request then we need + * to put it back on lockd's block list + */ + if (wait) + break; ret = nlm_lck_denied; - break; + goto out; case FILE_LOCK_DEFERRED: if (wait) break; @@ -443,10 +450,6 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file, goto out; } - ret = nlm_lck_denied; - if (!wait) - goto out; - ret = nlm_lck_blocked; /* Append to list of blocked */