aboutsummaryrefslogtreecommitdiffstats
path: root/fs/logfs/super.c
diff options
context:
space:
mode:
authorJoern Engel <joern@logfs.org>2010-03-05 10:07:04 -0500
committerJoern Engel <joern@logfs.org>2010-03-05 10:07:04 -0500
commit6a08ab846cefc82a328cbf9abd96c2e58a6c3664 (patch)
tree28aca16fc73f9b413d1ae9e67d97cdab39e869b6 /fs/logfs/super.c
parentc6d3830140f1d56b07d8ab56a6e14ca3c492a39a (diff)
[LogFS] Check feature flags
Diffstat (limited to 'fs/logfs/super.c')
-rw-r--r--fs/logfs/super.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/logfs/super.c b/fs/logfs/super.c
index 1d081b7ede5a..c66beab78dee 100644
--- a/fs/logfs/super.c
+++ b/fs/logfs/super.c
@@ -440,7 +440,7 @@ static int __logfs_read_sb(struct super_block *sb)
440 return 0; 440 return 0;
441} 441}
442 442
443static int logfs_read_sb(struct super_block *sb) 443static int logfs_read_sb(struct super_block *sb, int read_only)
444{ 444{
445 struct logfs_super *super = logfs_super(sb); 445 struct logfs_super *super = logfs_super(sb);
446 int ret; 446 int ret;
@@ -460,6 +460,12 @@ static int logfs_read_sb(struct super_block *sb)
460 if (ret) 460 if (ret)
461 return ret; 461 return ret;
462 462
463 if (super->s_feature_incompat & ~LOGFS_FEATURES_INCOMPAT)
464 return -EIO;
465 if ((super->s_feature_ro_compat & ~LOGFS_FEATURES_RO_COMPAT) &&
466 !read_only)
467 return -EIO;
468
463 mutex_init(&super->s_dirop_mutex); 469 mutex_init(&super->s_dirop_mutex);
464 mutex_init(&super->s_object_alias_mutex); 470 mutex_init(&super->s_object_alias_mutex);
465 INIT_LIST_HEAD(&super->s_freeing_list); 471 INIT_LIST_HEAD(&super->s_freeing_list);
@@ -555,7 +561,7 @@ int logfs_get_sb_device(struct file_system_type *type, int flags,
555 sb->s_op = &logfs_super_operations; 561 sb->s_op = &logfs_super_operations;
556 sb->s_flags = flags | MS_NOATIME; 562 sb->s_flags = flags | MS_NOATIME;
557 563
558 err = logfs_read_sb(sb); 564 err = logfs_read_sb(sb, sb->s_flags & MS_RDONLY);
559 if (err) 565 if (err)
560 goto err1; 566 goto err1;
561 567