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);
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",