Skip to content

Commit

Permalink
lockd: clean up blocking lock cases of nlsmvc_lock()
Browse files Browse the repository at this point in the history
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 <mszeredi@suse.cz>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
  • Loading branch information
Miklos Szeredi authored and J. Bruce Fields committed Mar 18, 2009
1 parent e37da04 commit e33d1ea
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions fs/lockd/svclock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 */
Expand Down

0 comments on commit e33d1ea

Please sign in to comment.