diff options
author | Jan Kara <jack@suse.cz> | 2012-12-20 00:07:18 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2012-12-20 00:07:18 -0500 |
commit | 261cb20cb2f0737a247aaf08dff7eb065e3e5b66 (patch) | |
tree | 0205a427601caf513c17aa22a8991ccedf1c95c8 /fs | |
parent | c36575e663e302dbaa4d16b9c72d2c9a913a9aef (diff) |
ext4: check dioread_nolock on remount
Currently we allow enabling dioread_nolock mount option on remount for
filesystems where blocksize < PAGE_CACHE_SIZE. This isn't really
supported so fix the bug by moving the check for blocksize !=
PAGE_CACHE_SIZE into parse_options(). Change the original PAGE_SIZE to
PAGE_CACHE_SIZE along the way because that's what we are really
interested in.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Cc: stable@vger.kernel.org
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext4/super.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 3cdb0a2fc648..e09f7d1646ba 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -1645,9 +1645,7 @@ static int parse_options(char *options, struct super_block *sb, | |||
1645 | unsigned int *journal_ioprio, | 1645 | unsigned int *journal_ioprio, |
1646 | int is_remount) | 1646 | int is_remount) |
1647 | { | 1647 | { |
1648 | #ifdef CONFIG_QUOTA | ||
1649 | struct ext4_sb_info *sbi = EXT4_SB(sb); | 1648 | struct ext4_sb_info *sbi = EXT4_SB(sb); |
1650 | #endif | ||
1651 | char *p; | 1649 | char *p; |
1652 | substring_t args[MAX_OPT_ARGS]; | 1650 | substring_t args[MAX_OPT_ARGS]; |
1653 | int token; | 1651 | int token; |
@@ -1696,6 +1694,16 @@ static int parse_options(char *options, struct super_block *sb, | |||
1696 | } | 1694 | } |
1697 | } | 1695 | } |
1698 | #endif | 1696 | #endif |
1697 | if (test_opt(sb, DIOREAD_NOLOCK)) { | ||
1698 | int blocksize = | ||
1699 | BLOCK_SIZE << le32_to_cpu(sbi->s_es->s_log_block_size); | ||
1700 | |||
1701 | if (blocksize < PAGE_CACHE_SIZE) { | ||
1702 | ext4_msg(sb, KERN_ERR, "can't mount with " | ||
1703 | "dioread_nolock if block size != PAGE_SIZE"); | ||
1704 | return 0; | ||
1705 | } | ||
1706 | } | ||
1699 | return 1; | 1707 | return 1; |
1700 | } | 1708 | } |
1701 | 1709 | ||
@@ -3436,15 +3444,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) | |||
3436 | clear_opt(sb, DELALLOC); | 3444 | clear_opt(sb, DELALLOC); |
3437 | } | 3445 | } |
3438 | 3446 | ||
3439 | blocksize = BLOCK_SIZE << le32_to_cpu(es->s_log_block_size); | ||
3440 | if (test_opt(sb, DIOREAD_NOLOCK)) { | ||
3441 | if (blocksize < PAGE_SIZE) { | ||
3442 | ext4_msg(sb, KERN_ERR, "can't mount with " | ||
3443 | "dioread_nolock if block size != PAGE_SIZE"); | ||
3444 | goto failed_mount; | ||
3445 | } | ||
3446 | } | ||
3447 | |||
3448 | sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | | 3447 | sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | |
3449 | (test_opt(sb, POSIX_ACL) ? MS_POSIXACL : 0); | 3448 | (test_opt(sb, POSIX_ACL) ? MS_POSIXACL : 0); |
3450 | 3449 | ||
@@ -3486,6 +3485,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) | |||
3486 | if (!ext4_feature_set_ok(sb, (sb->s_flags & MS_RDONLY))) | 3485 | if (!ext4_feature_set_ok(sb, (sb->s_flags & MS_RDONLY))) |
3487 | goto failed_mount; | 3486 | goto failed_mount; |
3488 | 3487 | ||
3488 | blocksize = BLOCK_SIZE << le32_to_cpu(es->s_log_block_size); | ||
3489 | if (blocksize < EXT4_MIN_BLOCK_SIZE || | 3489 | if (blocksize < EXT4_MIN_BLOCK_SIZE || |
3490 | blocksize > EXT4_MAX_BLOCK_SIZE) { | 3490 | blocksize > EXT4_MAX_BLOCK_SIZE) { |
3491 | ext4_msg(sb, KERN_ERR, | 3491 | ext4_msg(sb, KERN_ERR, |