linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: Check dioread_nolock on remount
@ 2012-12-13 21:40 Jan Kara
  2012-12-17 15:43 ` Eric Sandeen
  2012-12-20  5:07 ` Theodore Ts'o
  0 siblings, 2 replies; 3+ messages in thread
From: Jan Kara @ 2012-12-13 21:40 UTC (permalink / raw)
  To: Ted Tso; +Cc: linux-ext4, Jan Kara

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>
---
 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 80928f7..9753ed2 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1650,9 +1650,7 @@ static int parse_options(char *options, struct super_block *sb,
 			 unsigned int *journal_ioprio,
 			 int is_remount)
 {
-#ifdef CONFIG_QUOTA
 	struct ext4_sb_info *sbi = EXT4_SB(sb);
-#endif
 	char *p;
 	substring_t args[MAX_OPT_ARGS];
 	int token;
@@ -1701,6 +1699,16 @@ static int parse_options(char *options, struct super_block *sb,
 		}
 	}
 #endif
+	if (test_opt(sb, DIOREAD_NOLOCK)) {
+		int blocksize =
+			BLOCK_SIZE << le32_to_cpu(sbi->s_es->s_log_block_size);
+
+		if (blocksize < PAGE_CACHE_SIZE) {
+			ext4_msg(sb, KERN_ERR, "can't mount with "
+				 "dioread_nolock if block size != PAGE_SIZE");
+			return 0;
+		}
+	}
 	return 1;
 }
 
@@ -3446,15 +3454,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
 			clear_opt(sb, DELALLOC);
 	}
 
-	blocksize = BLOCK_SIZE << le32_to_cpu(es->s_log_block_size);
-	if (test_opt(sb, DIOREAD_NOLOCK)) {
-		if (blocksize < PAGE_SIZE) {
-			ext4_msg(sb, KERN_ERR, "can't mount with "
-				 "dioread_nolock if block size != PAGE_SIZE");
-			goto failed_mount;
-		}
-	}

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ext4: Check dioread_nolock on remount
  2012-12-13 21:40 [PATCH] ext4: Check dioread_nolock on remount Jan Kara
@ 2012-12-17 15:43 ` Eric Sandeen
  2012-12-20  5:07 ` Theodore Ts'o
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Sandeen @ 2012-12-17 15:43 UTC (permalink / raw)
  To: Jan Kara; +Cc: Ted Tso, linux-ext4

On 12/13/12 3:40 PM, Jan Kara wrote:
> 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>

Looks good to me,

Reviewed-by: Eric Sandeen <sandeen@redhat.com>

> ---
>  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 80928f7..9753ed2 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -1650,9 +1650,7 @@ static int parse_options(char *options, struct super_block *sb,
>  			 unsigned int *journal_ioprio,
>  			 int is_remount)
>  {
> -#ifdef CONFIG_QUOTA
>  	struct ext4_sb_info *sbi = EXT4_SB(sb);
> -#endif
>  	char *p;
>  	substring_t args[MAX_OPT_ARGS];
>  	int token;
> @@ -1701,6 +1699,16 @@ static int parse_options(char *options, struct super_block *sb,
>  		}
>  	}
>  #endif
> +	if (test_opt(sb, DIOREAD_NOLOCK)) {
> +		int blocksize =
> +			BLOCK_SIZE << le32_to_cpu(sbi->s_es->s_log_block_size);
> +
> +		if (blocksize < PAGE_CACHE_SIZE) {
> +			ext4_msg(sb, KERN_ERR, "can't mount with "
> +				 "dioread_nolock if block size != PAGE_SIZE");
> +			return 0;
> +		}
> +	}
>  	return 1;
>  }
>  
> @@ -3446,15 +3454,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
>  			clear_opt(sb, DELALLOC);
>  	}
>  
> -	blocksize = BLOCK_SIZE << le32_to_cpu(es->s_log_block_size);
> -	if (test_opt(sb, DIOREAD_NOLOCK)) {
> -		if (blocksize < PAGE_SIZE) {
> -			ext4_msg(sb, KERN_ERR, "can't mount with "
> -				 "dioread_nolock if block size != PAGE_SIZE");
> -			goto failed_mount;
> -		}
> -	}
> -
>  	sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
>  		(test_opt(sb, POSIX_ACL) ? MS_POSIXACL : 0);
>  
> @@ -3496,6 +3495,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
>  	if (!ext4_feature_set_ok(sb, (sb->s_flags & MS_RDONLY)))
>  		goto failed_mount;
>  
> +	blocksize = BLOCK_SIZE << le32_to_cpu(es->s_log_block_size);
>  	if (blocksize < EXT4_MIN_BLOCK_SIZE ||
>  	    blocksize > EXT4_MAX_BLOCK_SIZE) {
>  		ext4_msg(sb, KERN_ERR,
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ext4: Check dioread_nolock on remount
  2012-12-13 21:40 [PATCH] ext4: Check dioread_nolock on remount Jan Kara
  2012-12-17 15:43 ` Eric Sandeen
@ 2012-12-20  5:07 ` Theodore Ts'o
  1 sibling, 0 replies; 3+ messages in thread
From: Theodore Ts'o @ 2012-12-20  5:07 UTC (permalink / raw)
  To: Jan Kara; +Cc: linux-ext4

On Thu, Dec 13, 2012 at 10:40:42PM +0100, Jan Kara wrote:
> 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>

Applied, thanks.

					- Ted

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-12-20  5:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-13 21:40 [PATCH] ext4: Check dioread_nolock on remount Jan Kara
2012-12-17 15:43 ` Eric Sandeen
2012-12-20  5:07 ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).