linux/fs/ext4
Dmitry Mishin ceea16bf85 [PATCH] ext4: errors behaviour fix
Current error behaviour for ext2 and ext3 filesystems does not fully
correspond to the documentation and should be fixed.

According to man 8 mount, ext2 and ext3 file systems allow to set one of 3
different on-errors behaviours:

  ---- start of quote man 8 mount ----

  errors=continue / errors=remount-ro / errors=panic

    Define the behaviour when an error is encountered.  (Either ignore
    errors and just mark the file system erroneous and continue, or remount
    the file system read-only, or panic and halt the system.) The default is
    set in the filesystem superblock, and can be changed using tune2fs(8).

  ---- end of quote ----

However EXT3_ERRORS_CONTINUE is not read from the superblock, and thus
ERRORS_CONT is not saved on the sbi->s_mount_opt.  It leads to the incorrect
handle of errors on ext3.

Then we've checked corresponding code in ext2 and discovered that it is buggy
as well:

- EXT2_ERRORS_CONTINUE is not read from the superblock (the same);

- parse_option() does not clean the alternative values and thus something
  like (ERRORS_CONT|ERRORS_RO) can be set;

- if options are omitted, parse_option() does not set any of these options.

Therefore it is possible to set any combination of these options on the ext2:

- none of them may be set: EXT2_ERRORS_CONTINUE on superblock / empty mount
  options;

- any of them may be set using mount options;

- 2 any options may be set: by using EXT2_ERRORS_RO/EXT2_ERRORS_PANIC on the
  superblock and other value in mount options;

- and finally all three options may be set by adding third option in remount.

Currently ext2 uses these values only in ext2_error() and it is not leading to
any noticeable troubles.  However somebody may be discouraged when he will try
to workaround EXT2_ERRORS_PANIC on the superblock by using errors=continue in
mount options.

This patch:

EXT4_ERRORS_CONTINUE should be taken from the superblock as default value for
error behaviour.

Signed-off-by:	Dmitry Mishin <dim@openvz.org>
Acked-by: Vasily Averin <vvs@sw.ru>
Acked-by: Kirill Korotaev <dev@openvz.org>
Cc: <linux-ext4@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-10-11 11:14:19 -07:00
..
acl.c [PATCH] jbd2: enable building of jbd2 and have ext4 use it rather than jbd 2006-10-11 11:14:16 -07:00
acl.h [PATCH] ext4: rename ext4 symbols to avoid duplication of ext3 symbols 2006-10-11 11:14:15 -07:00
balloc.c [PATCH] ext4 64 bit divide fix 2006-10-11 11:14:18 -07:00
bitmap.c [PATCH] jbd2: enable building of jbd2 and have ext4 use it rather than jbd 2006-10-11 11:14:16 -07:00
dir.c [PATCH] ext3: add extent map support 2006-10-11 11:14:16 -07:00
extents.c [PATCH] ext4: removesector_t bits check 2006-10-11 11:14:18 -07:00
file.c [PATCH] jbd2: enable building of jbd2 and have ext4 use it rather than jbd 2006-10-11 11:14:16 -07:00
fsync.c [PATCH] jbd2: enable building of jbd2 and have ext4 use it rather than jbd 2006-10-11 11:14:16 -07:00
hash.c [PATCH] jbd2: enable building of jbd2 and have ext4 use it rather than jbd 2006-10-11 11:14:16 -07:00
ialloc.c [PATCH] ext4 64 bit divide fix 2006-10-11 11:14:18 -07:00
inode.c [PATCH] ext4: move block number hi bits 2006-10-11 11:14:18 -07:00
ioctl.c [PATCH] ext3: add extent map support 2006-10-11 11:14:16 -07:00
Makefile [PATCH] ext3: add extent map support 2006-10-11 11:14:16 -07:00
namei.c [PATCH] jbd2: enable building of jbd2 and have ext4 use it rather than jbd 2006-10-11 11:14:16 -07:00
namei.h [PATCH] ext4: rename ext4 symbols to avoid duplication of ext3 symbols 2006-10-11 11:14:15 -07:00
resize.c [PATCH] ext4: move block number hi bits 2006-10-11 11:14:18 -07:00
super.c [PATCH] ext4: errors behaviour fix 2006-10-11 11:14:19 -07:00
symlink.c [PATCH] jbd2: enable building of jbd2 and have ext4 use it rather than jbd 2006-10-11 11:14:16 -07:00
xattr_security.c [PATCH] jbd2: enable building of jbd2 and have ext4 use it rather than jbd 2006-10-11 11:14:16 -07:00
xattr_trusted.c [PATCH] jbd2: enable building of jbd2 and have ext4 use it rather than jbd 2006-10-11 11:14:16 -07:00
xattr_user.c [PATCH] jbd2: enable building of jbd2 and have ext4 use it rather than jbd 2006-10-11 11:14:16 -07:00
xattr.c [PATCH] ext4: blk_type from sector_t to unsigned long long 2006-10-11 11:14:18 -07:00
xattr.h [PATCH] ext4: rename ext4 symbols to avoid duplication of ext3 symbols 2006-10-11 11:14:15 -07:00