Skip to content

Commit

Permalink
ext4: snapshot rocompat - enable rw mount
Browse files Browse the repository at this point in the history
Enable readwrite mount of filesystem with has_snapshot feature only
if ext4 was compiled with snapshot support.


Signed-off-by: Amir Goldstein <amir73il@users.sf.net>
Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com>
  • Loading branch information
Amir Goldstein committed Jun 6, 2011
1 parent 0cd70d8 commit 19941e7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions fs/ext4/ext4.h
Expand Up @@ -1483,6 +1483,7 @@ static inline void ext4_clear_state_flags(struct ext4_inode_info *ei)
EXT4_FEATURE_INCOMPAT_FLEX_BG)
#define EXT4_FEATURE_RO_COMPAT_SUPP (EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER| \
EXT4_FEATURE_RO_COMPAT_LARGE_FILE| \
EXT4_FEATURE_RO_COMPAT_HAS_SNAPSHOT| \
EXT4_FEATURE_RO_COMPAT_GDT_CSUM| \
EXT4_FEATURE_RO_COMPAT_DIR_NLINK | \
EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE | \
Expand Down
10 changes: 10 additions & 0 deletions fs/ext4/super.c
Expand Up @@ -2693,6 +2693,16 @@ static int ext4_feature_set_ok(struct super_block *sb, int readonly)
"must run fsck -xy to make it writable.");
return 0;
}
} else if (EXT4_HAS_RO_COMPAT_FEATURE(sb,
EXT4_FEATURE_RO_COMPAT_HAS_SNAPSHOT)) {
/*
* We get here when CONFIG_EXT4_FS_SNAPSHOT is not defined
* so EXT4_SNAPSHOTS(sb) is defined to (0)
*/
ext4_msg(sb, KERN_ERR,
"Filesystem with has_snapshot feature cannot be "
"mounted RDWR without CONFIG_EXT4_FS_SNAPSHOT");
return 0;
}
return 1;
}
Expand Down

0 comments on commit 19941e7

Please sign in to comment.