diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-22 21:05:13 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-22 21:05:13 -0500 |
commit | feaf222925cdfbc841a695fd30df8c6d0a694146 (patch) | |
tree | 9bba94f19346cd3cba0223741b38885b898491ae /fs/ext4/super.c | |
parent | be5e6616dd74e17fdd8e16ca015cfef94d49b467 (diff) | |
parent | 6f30b7e37a8239f9d27db626a1d3427bc7951908 (diff) |
Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
Pull ext4 fixes from Ted Ts'o:
"Ext4 bug fixes.
We also reserved code points for encryption and read-only images (for
which the implementation is mostly just the reserved code point for a
read-only feature :-)"
* tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
ext4: fix indirect punch hole corruption
ext4: ignore journal checksum on remount; don't fail
ext4: remove duplicate remount check for JOURNAL_CHECKSUM change
ext4: fix mmap data corruption in nodelalloc mode when blocksize < pagesize
ext4: support read-only images
ext4: change to use setup_timer() instead of init_timer()
ext4: reserve codepoints used by the ext4 encryption feature
jbd2: complain about descriptor block checksum errors
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 1adac6868e6f..e061e66c8280 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -2779,6 +2779,12 @@ static int ext4_feature_set_ok(struct super_block *sb, int readonly) | |||
2779 | if (readonly) | 2779 | if (readonly) |
2780 | return 1; | 2780 | return 1; |
2781 | 2781 | ||
2782 | if (EXT4_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_READONLY)) { | ||
2783 | ext4_msg(sb, KERN_INFO, "filesystem is read-only"); | ||
2784 | sb->s_flags |= MS_RDONLY; | ||
2785 | return 1; | ||
2786 | } | ||
2787 | |||
2782 | /* Check that feature set is OK for a read-write mount */ | 2788 | /* Check that feature set is OK for a read-write mount */ |
2783 | if (EXT4_HAS_RO_COMPAT_FEATURE(sb, ~EXT4_FEATURE_RO_COMPAT_SUPP)) { | 2789 | if (EXT4_HAS_RO_COMPAT_FEATURE(sb, ~EXT4_FEATURE_RO_COMPAT_SUPP)) { |
2784 | ext4_msg(sb, KERN_ERR, "couldn't mount RDWR because of " | 2790 | ext4_msg(sb, KERN_ERR, "couldn't mount RDWR because of " |
@@ -3936,9 +3942,8 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) | |||
3936 | get_random_bytes(&sbi->s_next_generation, sizeof(u32)); | 3942 | get_random_bytes(&sbi->s_next_generation, sizeof(u32)); |
3937 | spin_lock_init(&sbi->s_next_gen_lock); | 3943 | spin_lock_init(&sbi->s_next_gen_lock); |
3938 | 3944 | ||
3939 | init_timer(&sbi->s_err_report); | 3945 | setup_timer(&sbi->s_err_report, print_daily_error_info, |
3940 | sbi->s_err_report.function = print_daily_error_info; | 3946 | (unsigned long) sb); |
3941 | sbi->s_err_report.data = (unsigned long) sb; | ||
3942 | 3947 | ||
3943 | /* Register extent status tree shrinker */ | 3948 | /* Register extent status tree shrinker */ |
3944 | if (ext4_es_register_shrinker(sbi)) | 3949 | if (ext4_es_register_shrinker(sbi)) |
@@ -4866,9 +4871,6 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) | |||
4866 | if (sbi->s_journal && sbi->s_journal->j_task->io_context) | 4871 | if (sbi->s_journal && sbi->s_journal->j_task->io_context) |
4867 | journal_ioprio = sbi->s_journal->j_task->io_context->ioprio; | 4872 | journal_ioprio = sbi->s_journal->j_task->io_context->ioprio; |
4868 | 4873 | ||
4869 | /* | ||
4870 | * Allow the "check" option to be passed as a remount option. | ||
4871 | */ | ||
4872 | if (!parse_options(data, sb, NULL, &journal_ioprio, 1)) { | 4874 | if (!parse_options(data, sb, NULL, &journal_ioprio, 1)) { |
4873 | err = -EINVAL; | 4875 | err = -EINVAL; |
4874 | goto restore_opts; | 4876 | goto restore_opts; |
@@ -4877,17 +4879,8 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) | |||
4877 | if ((old_opts.s_mount_opt & EXT4_MOUNT_JOURNAL_CHECKSUM) ^ | 4879 | if ((old_opts.s_mount_opt & EXT4_MOUNT_JOURNAL_CHECKSUM) ^ |
4878 | test_opt(sb, JOURNAL_CHECKSUM)) { | 4880 | test_opt(sb, JOURNAL_CHECKSUM)) { |
4879 | ext4_msg(sb, KERN_ERR, "changing journal_checksum " | 4881 | ext4_msg(sb, KERN_ERR, "changing journal_checksum " |
4880 | "during remount not supported"); | 4882 | "during remount not supported; ignoring"); |
4881 | err = -EINVAL; | 4883 | sbi->s_mount_opt ^= EXT4_MOUNT_JOURNAL_CHECKSUM; |
4882 | goto restore_opts; | ||
4883 | } | ||
4884 | |||
4885 | if ((old_opts.s_mount_opt & EXT4_MOUNT_JOURNAL_CHECKSUM) ^ | ||
4886 | test_opt(sb, JOURNAL_CHECKSUM)) { | ||
4887 | ext4_msg(sb, KERN_ERR, "changing journal_checksum " | ||
4888 | "during remount not supported"); | ||
4889 | err = -EINVAL; | ||
4890 | goto restore_opts; | ||
4891 | } | 4884 | } |
4892 | 4885 | ||
4893 | if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) { | 4886 | if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) { |
@@ -4963,7 +4956,9 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) | |||
4963 | ext4_mark_recovery_complete(sb, es); | 4956 | ext4_mark_recovery_complete(sb, es); |
4964 | } else { | 4957 | } else { |
4965 | /* Make sure we can mount this feature set readwrite */ | 4958 | /* Make sure we can mount this feature set readwrite */ |
4966 | if (!ext4_feature_set_ok(sb, 0)) { | 4959 | if (EXT4_HAS_RO_COMPAT_FEATURE(sb, |
4960 | EXT4_FEATURE_RO_COMPAT_READONLY) || | ||
4961 | !ext4_feature_set_ok(sb, 0)) { | ||
4967 | err = -EROFS; | 4962 | err = -EROFS; |
4968 | goto restore_opts; | 4963 | goto restore_opts; |
4969 | } | 4964 | } |