Whamcloud - gitweb
LU-887 mgc: prevent client IR with old server
authorBobi Jam <bobijam@whamcloud.com>
Sat, 3 Dec 2011 14:21:46 +0000 (22:21 +0800)
committerOleg Drokin <green@whamcloud.com>
Wed, 7 Dec 2011 19:43:15 +0000 (14:43 -0500)
Prevent IR enabled client start IR handling with IR unawared MGS
server.

Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: I9773eafa437358dbf4988e0fddd490b0daf59358
Reviewed-on: http://review.whamcloud.com/1798
Tested-by: Hudson
Reviewed-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/mgc/mgc_request.c

index a628354..49262b4 100644 (file)
@@ -1905,8 +1905,15 @@ static int mgc_process_config(struct obd_device *obd, obd_count len, void *buf)
                 cld->cld_cfg.cfg_flags |= CFG_F_COMPAT146;
 
                 rc = mgc_process_log(obd, cld);
-                if (rc == 0 && cld->cld_recover) {
-                        rc = mgc_process_log(obd, cld->cld_recover);
+                if (rc == 0 && cld->cld_recover != NULL) {
+                        if (OCD_HAS_FLAG(&obd->u.cli.cl_import->
+                                         imp_connect_data, IMP_RECOV)) {
+                                rc = mgc_process_log(obd, cld->cld_recover);
+                        } else {
+                                struct config_llog_data *cir = cld->cld_recover;
+                                cld->cld_recover = NULL;
+                                config_log_put(cir);
+                        }
                         if (rc)
                                 CERROR("Cannot process recover llog %d\n", rc);
                 }