ocfs2: return -EROFS to mount.ocfs2 if inode block is invalid
[sfrench/cifs-2.6.git] / fs / ocfs2 / super.c
index 350066e9d60b52b77e0a002be77f7965cf884c1f..ffa4952d432b29edfd0c15cae8c3e642398aab85 100644 (file)
@@ -474,9 +474,8 @@ static int ocfs2_init_global_system_inodes(struct ocfs2_super *osb)
                new = ocfs2_get_system_file_inode(osb, i, osb->slot_num);
                if (!new) {
                        ocfs2_release_system_inodes(osb);
-                       status = -EINVAL;
+                       status = ocfs2_is_soft_readonly(osb) ? -EROFS : -EINVAL;
                        mlog_errno(status);
-                       /* FIXME: Should ERROR_RO_FS */
                        mlog(ML_ERROR, "Unable to load system inode %d, "
                             "possibly corrupt fs?", i);
                        goto bail;
@@ -505,7 +504,7 @@ static int ocfs2_init_local_system_inodes(struct ocfs2_super *osb)
                new = ocfs2_get_system_file_inode(osb, i, osb->slot_num);
                if (!new) {
                        ocfs2_release_system_inodes(osb);
-                       status = -EINVAL;
+                       status = ocfs2_is_soft_readonly(osb) ? -EROFS : -EINVAL;
                        mlog(ML_ERROR, "status=%d, sysfile=%d, slot=%d\n",
                             status, i, osb->slot_num);
                        goto bail;