]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - fs/lockd/svclock.c
lockd: call locks_release_private to cleanup per-filesystem state
[net-next-2.6.git] / fs / lockd / svclock.c
index 763b78a6e9de41dc9b6c5c0fb6bd438563f14c14..e577a78d7bacf9e07d3cb50f4bb657d30d5e9446 100644 (file)
@@ -326,6 +326,8 @@ static void nlmsvc_freegrantargs(struct nlm_rqst *call)
 {
        if (call->a_args.lock.oh.data != call->a_owner)
                kfree(call->a_args.lock.oh.data);
+
+       locks_release_private(&call->a_args.lock.fl);
 }
 
 /*
@@ -426,8 +428,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 +452,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 */