Whamcloud - gitweb
b=18470
authorgirish <girish>
Mon, 16 Feb 2009 07:47:34 +0000 (07:47 +0000)
committergirish <girish>
Mon, 16 Feb 2009 07:47:34 +0000 (07:47 +0000)
i=johann
i=adilger

Correct error handling

lustre/mgs/mgs_handler.c

index 8861a75..97878c8 100644 (file)
@@ -212,6 +212,12 @@ static int mgs_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
         if (IS_ERR(obd->obd_fsops))
                 GOTO(err_put, rc = PTR_ERR(obd->obd_fsops));
 
+        if (lvfs_check_rdonly(lvfs_sbdev(mnt->mnt_sb))) {
+                CERROR("%s: Underlying device is marked as read-only. "
+                       "Setup failed\n", obd->obd_name);
+                GOTO(err_ops, rc = -EROFS);
+        }
+
         /* namespace for mgs llog */
         obd->obd_namespace = ldlm_namespace_new(obd ,"MGS", LDLM_NAMESPACE_SERVER,
                                                 LDLM_NAMESPACE_MODEST);
@@ -222,12 +228,6 @@ static int mgs_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
         ptlrpc_init_client(LDLM_CB_REQUEST_PORTAL, LDLM_CB_REPLY_PORTAL,
                            "mgs_ldlm_client", &obd->obd_ldlm_client);
 
-        if (lvfs_check_rdonly(lvfs_sbdev(mnt->mnt_sb))) {
-                CERROR("%s: Underlying device is marked as read-only. "
-                       "Setup failed\n", obd->obd_name);
-                GOTO(err_ops, rc = -EROFS);
-        }
-
         rc = mgs_fs_setup(obd, mnt);
         if (rc) {
                 CERROR("%s: MGS filesystem method init failed: rc = %d\n",