@@ -1306,10 +1306,10 @@ static int ptlrpc_connect_interpret(const struct lu_env *env,
time64_t next_connect;
import_set_state_nolock(imp, LUSTRE_IMP_DISCON);
- if (rc == -EACCES) {
+ if (rc == -EACCES || rc == -EROFS) {
/*
* Give up trying to reconnect
- * EACCES means client has no permission for connection
+ * EROFS means client must mount read-only
*/
imp->imp_obd->obd_no_recov = 1;
ptlrpc_deactivate_import_nolock(imp);
@@ -472,7 +472,8 @@ int ptlrpc_send_error(struct ptlrpc_request *req, int may_be_difficult)
if (req->rq_status != -ENOSPC && req->rq_status != -EACCES &&
req->rq_status != -EPERM && req->rq_status != -ENOENT &&
- req->rq_status != -EINPROGRESS && req->rq_status != -EDQUOT)
+ req->rq_status != -EINPROGRESS && req->rq_status != -EDQUOT &&
+ req->rq_status != -EROFS)
req->rq_type = PTL_RPC_MSG_ERR;
rc = ptlrpc_send_reply(req, may_be_difficult);