Whamcloud - gitweb
Branch: b1_6
authorwangdi <wangdi>
Tue, 11 Sep 2007 21:00:02 +0000 (21:00 +0000)
committerwangdi <wangdi>
Tue, 11 Sep 2007 21:00:02 +0000 (21:00 +0000)
b=13436
Only disconnect errors(ENOTCONNECT & ENODEV) should be returned by rq_status.
i=green
i=adiger

lustre/ChangeLog
lustre/mds/handler.c

index 769981c..eb552ca 100644 (file)
@@ -170,6 +170,15 @@ Bugzilla   : 13532
 Description: rewrite ext2-derived code in llite/dir.c and obdclass/uuid.c
 Details    : rewrite inherited code (uuid parsing code from ext2 utils and
              readdir code from ext3) from scratch preserving functionality.
+
+Severity   : normal 
+Bugzilla   : 13436
+Description: Only those disconnect error should be returned by rq_status.
+Details    : In open/enqueue processs, Some errors, which will cause client 
+            disconnected, should be returned by rq_status, while other 
+            errors should still be returned by intent, then mdc or llite will
+            detect them.
+
 --------------------------------------------------------------------------------
 
 2007-08-27         Cluster File Systems, Inc. <info@clusterfs.com>
index e7a1fc6..4b23502 100644 (file)
@@ -2333,6 +2333,9 @@ void intent_set_disposition(struct ldlm_reply *rep, int flag)
         rep->lock_policy_res1 |= flag;
 }
 
+#define IS_CLIENT_DISCONNECT_ERROR(error) \
+                (error == -ENOTCONN || error == -ENODEV)
+
 static int mds_intent_policy(struct ldlm_namespace *ns,
                              struct ldlm_lock **lockp, void *req_cookie,
                              ldlm_mode_t mode, int flags, void *data)
@@ -2407,10 +2410,18 @@ static int mds_intent_policy(struct ldlm_namespace *ns,
 
                 /* If there was an error of some sort or if we are not
                  * returning any locks */
-                if (rep->lock_policy_res2)
-                        RETURN(rep->lock_policy_res2);
-                if (!intent_disposition(rep, DISP_OPEN_LOCK))
-                        RETURN(ELDLM_LOCK_ABORTED);
+                 if (rep->lock_policy_res2 ||
+                     !intent_disposition(rep, DISP_OPEN_LOCK)) {
+                        /* If it is the disconnect error (ENODEV & ENOCONN)
+                         * ptlrpc layer should know this imediately, it should
+                         * be replied by rq_stats, otherwise, return it by 
+                         * intent here
+                         */
+                        if (IS_CLIENT_DISCONNECT_ERROR(rep->lock_policy_res2))
+                                RETURN(rep->lock_policy_res2);
+                        else
+                                RETURN(ELDLM_LOCK_ABORTED);
+                 }
                 break;
         case IT_LOOKUP:
                         getattr_part = MDS_INODELOCK_LOOKUP;