diff options
author | Salah Triki <salah.triki@gmail.com> | 2016-08-09 16:46:04 +0300 |
---|---|---|
committer | Luis de Bethencourt <luisbg@osg.samsung.com> | 2016-10-08 12:01:27 +0300 |
commit | 6ea4558f9b373b588162e5d3523bc65fcf669b06 (patch) | |
tree | 18fe35d58b8a866a664feda907db2e107bb1ef4c /fs/befs/super.c | |
parent | bb75e66627b28816f472183d5dce0784d5edb87f (diff) | |
download | linux-6ea4558f9b373b588162e5d3523bc65fcf669b06.tar.xz |
befs: add flags field to validate superblock state
For validating superblock state, add flags field to befs_sb_info, read the state from the disk
and check if it is equal to BEFS_DIRTY.
Signed-off-by: Salah Triki <salah.triki@gmail.com>
Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Diffstat (limited to 'fs/befs/super.c')
-rw-r--r-- | fs/befs/super.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/befs/super.c b/fs/befs/super.c index 9d1b56cd6f19..dc13df8de3e8 100644 --- a/fs/befs/super.c +++ b/fs/befs/super.c @@ -45,6 +45,8 @@ befs_load_sb(struct super_block *sb, befs_super_block * disk_sb) befs_sb->ag_shift = fs32_to_cpu(sb, disk_sb->ag_shift); befs_sb->num_ags = fs32_to_cpu(sb, disk_sb->num_ags); + befs_sb->flags = fs32_to_cpu(sb, disk_sb->flags); + befs_sb->log_blocks = fsrun_to_cpu(sb, disk_sb->log_blocks); befs_sb->log_start = fs64_to_cpu(sb, disk_sb->log_start); befs_sb->log_end = fs64_to_cpu(sb, disk_sb->log_end); @@ -101,7 +103,7 @@ befs_check_sb(struct super_block *sb) return BEFS_ERR; } - if (befs_sb->log_start != befs_sb->log_end) { + if (befs_sb->log_start != befs_sb->log_end || befs_sb->flags == BEFS_DIRTY) { befs_error(sb, "Filesystem not clean! There are blocks in the " "journal. You must boot into BeOS and mount this volume " "to make it clean."); |