[RFC][PATCH v2] NLM: Sending nfslock request fail should not be process as blocked

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi,

Sorry for sending this patch third times.

About this patch, I have discussed with Trond before. 
He said "An unlock does not guarantee that the server will cancel the blocked
lock request.", but when server receive an UNLOCK request, it will try to
cancel the lock at first, and then unlock the file.

  codes as follows:
    ...
    567 nlmsvc_unlock(struct nlm_file *file, struct nlm_lock *lock)
    568 {
    ....
    578         /* First, cancel any lock that might be there */
    579         nlmsvc_cancel_blocked(file, lock);
    ...

as before, the UNLOCK request means it contain a CANCEL request.

So, I don't know the reason in detail.

Waiting for some better analysis. Thanks.

-------------
If local reason cause nfslock request is sent fail(means status < 0,
but resp->status not be reset), the request will be process as blocked 
at the kernel.

If the network partition cause the LOCK request be sent fail, the 
kernel will processed it as being blocked right now, but sending
an UNLOCK request is needed but CANCEL request here.

Signed-off-by: Mi Jinlong <mijinlong@xxxxxxxxxxxxxx>

---
 fs/lockd/clntproc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c
index 7932c39..b79c8b1 100644
--- a/fs/lockd/clntproc.c
+++ b/fs/lockd/clntproc.c
@@ -536,7 +536,7 @@ again:
 	 * Initialise resp->status to a valid non-zero value,
 	 * since 0 == nlm_lck_granted
 	 */
-	resp->status = nlm_lck_blocked;
+	resp->status = nlm_lck_denied_nolocks;
 	for(;;) {
 		/* Reboot protection */
 		fl->fl_u.nfs_fl.state = host->h_state;
-- 
1.7.0



--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux