SIZE_CHECK(logfs_segment_header, LOGFS_SEGMENT_HEADERSIZE);
+#define LOGFS_FEATURES_INCOMPAT (0ull)
+#define LOGFS_FEATURES_RO_COMPAT (0ull)
+#define LOGFS_FEATURES_COMPAT (0ull)
+
/**
* struct logfs_disk_super - on-medium superblock
*
return 0;
}
-static int logfs_read_sb(struct super_block *sb)
+static int logfs_read_sb(struct super_block *sb, int read_only)
{
struct logfs_super *super = logfs_super(sb);
int ret;
if (ret)
return ret;
+ if (super->s_feature_incompat & ~LOGFS_FEATURES_INCOMPAT)
+ return -EIO;
+ if ((super->s_feature_ro_compat & ~LOGFS_FEATURES_RO_COMPAT) &&
+ !read_only)
+ return -EIO;
+
mutex_init(&super->s_dirop_mutex);
mutex_init(&super->s_object_alias_mutex);
INIT_LIST_HEAD(&super->s_freeing_list);
sb->s_op = &logfs_super_operations;
sb->s_flags = flags | MS_NOATIME;
- err = logfs_read_sb(sb);
+ err = logfs_read_sb(sb, sb->s_flags & MS_RDONLY);
if (err)
goto err1;