summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2013-09-13 17:41:20 +0200
committerChris Mason <chris.mason@fusionio.com>2013-09-21 11:05:30 -0400
commit6ef3de9c9252b186720122d3ae7122a81d49f8ee (patch)
treef6159369e950934cc5b90f4858a2ff902e95b201 /fs
parent1cecf579d161527f610ef0da852dd6122e434a49 (diff)
downloadlinux-6ef3de9c9252b186720122d3ae7122a81d49f8ee.tar.bz2
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.c6
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)
if (ret)
goto restore;
} else {
+ if (test_bit(BTRFS_FS_STATE_ERROR, &root->fs_info->fs_state)) {
+ btrfs_err(fs_info,
+ "Remounting read-write after error is not allowed\n");
+ ret = -EINVAL;
+ goto restore;
+ }
if (fs_info->fs_devices->rw_devices == 0) {
ret = -EACCES;
goto restore;