diff options
author | David Sterba <dsterba@suse.cz> | 2013-09-13 11:41:20 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-09-21 11:05:30 -0400 |
commit | 6ef3de9c9252b186720122d3ae7122a81d49f8ee (patch) | |
tree | f6159369e950934cc5b90f4858a2ff902e95b201 /fs | |
parent | 1cecf579d161527f610ef0da852dd6122e434a49 (diff) |
btrfs: refuse to remount read-write after abort
It's still possible to flip the filesystem into RW mode after it's
remounted RO due to an abort. There are lots of places that check for
the superblock error bit and will not write data, but we should not let
the filesystem appear read-write.
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/super.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index b341da3ee3ee..6ab0df59b6c4 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -1340,6 +1340,12 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data) | |||
1340 | if (ret) | 1340 | if (ret) |
1341 | goto restore; | 1341 | goto restore; |
1342 | } else { | 1342 | } else { |
1343 | if (test_bit(BTRFS_FS_STATE_ERROR, &root->fs_info->fs_state)) { | ||
1344 | btrfs_err(fs_info, | ||
1345 | "Remounting read-write after error is not allowed\n"); | ||
1346 | ret = -EINVAL; | ||
1347 | goto restore; | ||
1348 | } | ||
1343 | if (fs_info->fs_devices->rw_devices == 0) { | 1349 | if (fs_info->fs_devices->rw_devices == 0) { |
1344 | ret = -EACCES; | 1350 | ret = -EACCES; |
1345 | goto restore; | 1351 | goto restore; |