summaryrefslogtreecommitdiff
path: root/fs/btrfs
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2013-09-13 15:41:20 (GMT)
committerChris Mason <chris.mason@fusionio.com>2013-09-21 15:05:30 (GMT)
commit6ef3de9c9252b186720122d3ae7122a81d49f8ee (patch)
treef6159369e950934cc5b90f4858a2ff902e95b201 /fs/btrfs
parent1cecf579d161527f610ef0da852dd6122e434a49 (diff)
downloadlinux-fsl-qoriq-6ef3de9c9252b186720122d3ae7122a81d49f8ee.tar.xz
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/btrfs')
-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 b341da3..6ab0df5 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;