diff --git a/[refs] b/[refs] index 47bf5d0f24b3..cc515e4812ac 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8f82f840ec6ab873f520364d443ff6fa1b3f8e22 +refs/heads/master: ce723c31b58f54fb865036805475ee7a8c5dc173 diff --git a/trunk/fs/ext4/resize.c b/trunk/fs/ext4/resize.c index 0213f631271f..53d979541b31 100644 --- a/trunk/fs/ext4/resize.c +++ b/trunk/fs/ext4/resize.c @@ -23,6 +23,16 @@ int ext4_resize_begin(struct super_block *sb) if (!capable(CAP_SYS_RESOURCE)) return -EPERM; + /* + * We are not allowed to do online-resizing on a filesystem mounted + * with error, because it can destroy the filesystem easily. + */ + if (EXT4_SB(sb)->s_mount_state & EXT4_ERROR_FS) { + ext4_warning(sb, "There are errors in the filesystem, " + "so online resizing is not allowed\n"); + return -EPERM; + } + if (test_and_set_bit_lock(EXT4_RESIZING, &EXT4_SB(sb)->s_resize_flags)) ret = -EBUSY;