linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Robert Elliott <elliott@hpe.com>
Cc: jack@suse.com, tytso@mit.edu, adilger.kernel@dilger.ca,
	dan.j.williams@intel.com, choleraehyq@gmail.com,
	david@fromorbit.com, linux-nvdimm@lists.01.org,
	linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ext2, ext4: include filesystem block size in error messages
Date: Mon, 4 Jan 2016 10:04:44 +0100	[thread overview]
Message-ID: <20160104090444.GA3888@quack.suse.cz> (raw)
In-Reply-To: <1450915801-2320-1-git-send-email-elliott@hpe.com>

On Wed 23-12-15 18:10:01, Robert Elliott wrote:
> Print the problematic value in messages about the filesystem
> block size.
> 
> Normalize all of the blocksize messages that use "blocksize" to
> use "filesystem block size". This helps distinguish this block size
> from the underlying block device's logical block size (i.e.,
> sector size) and physical block size.
> 
> Example old messages:
> 	EXT2-fs (pmem0): unable to set blocksize
> 	EXT4-fs (pmem0): error: unsupported blocksize for dax
> 	EXT4-fs (pmem0): unsupported blocksize for fs encryption
> 	EXT2-fs (pmem0): bad blocksize %d
> 
> Example new message:
> 	EXT4-fs (pmem0): error: unsupported filesystem block size 2048 for dax

Looks good to me. You can add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza
> 
> Signed-off-by: Robert Elliott <elliott@hpe.com>
> ---
>  fs/ext2/super.c | 17 +++++++++++------
>  fs/ext4/super.c | 33 ++++++++++++++++++++-------------
>  2 files changed, 31 insertions(+), 19 deletions(-)
> 
> diff --git a/fs/ext2/super.c b/fs/ext2/super.c
> index 748d35a..1186a5b 100644
> --- a/fs/ext2/super.c
> +++ b/fs/ext2/super.c
> @@ -31,6 +31,7 @@
>  #include <linux/mount.h>
>  #include <linux/log2.h>
>  #include <linux/quotaops.h>
> +#include <linux/stringify.h>
>  #include <asm/uaccess.h>
>  #include "ext2.h"
>  #include "xattr.h"
> @@ -822,7 +823,9 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
>  	 */
>  	blocksize = sb_min_blocksize(sb, BLOCK_SIZE);
>  	if (!blocksize) {
> -		ext2_msg(sb, KERN_ERR, "error: unable to set blocksize");
> +		ext2_msg(sb, KERN_ERR,
> +			 "error: unable to set filesystem block size "
> +			 __stringify(BLOCK_SIZE));
>  		goto failed_sbi;
>  	}
>  
> @@ -921,7 +924,8 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
>  	if (sbi->s_mount_opt & EXT2_MOUNT_DAX) {
>  		if (blocksize != PAGE_SIZE) {
>  			ext2_msg(sb, KERN_ERR,
> -					"error: unsupported blocksize for dax");
> +			 "error: unsupported filesystem block size %d for dax",
> +				 blocksize);
>  			goto failed_mount;
>  		}
>  		if (!sb->s_bdev->bd_disk->fops->direct_access) {
> @@ -937,7 +941,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
>  
>  		if (!sb_set_blocksize(sb, blocksize)) {
>  			ext2_msg(sb, KERN_ERR,
> -				"error: bad blocksize %d", blocksize);
> +			 "error: bad filesystem block size %d", blocksize);
>  			goto failed_sbi;
>  		}
>  
> @@ -1007,14 +1011,15 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
>  
>  	if (sb->s_blocksize != bh->b_size) {
>  		if (!silent)
> -			ext2_msg(sb, KERN_ERR, "error: unsupported blocksize");
> +			ext2_msg(sb, KERN_ERR,
> +				 "error: unsupported filesystem block size %lu",
> +				 sb->s_blocksize);
>  		goto failed_mount;
>  	}
>  
>  	if (sb->s_blocksize != sbi->s_frag_size) {
>  		ext2_msg(sb, KERN_ERR,
> -			"error: fragsize %lu != blocksize %lu"
> -			"(not supported yet)",
> +	 "error: fragsize %lu != filesystem block size %lu (not supported yet)",
>  			sbi->s_frag_size, sb->s_blocksize);
>  		goto failed_mount;
>  	}
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index c9ab67d..9e1c049 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -42,6 +42,7 @@
>  
>  #include <linux/kthread.h>
>  #include <linux/freezer.h>
> +#include <linux/stringify.h>
>  
>  #include "ext4.h"
>  #include "ext4_extents.h"	/* Needed for trace points definition */
> @@ -1750,8 +1751,9 @@ static int parse_options(char *options, struct super_block *sb,
>  			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");
> +			ext4_msg(sb, KERN_ERR,
> +				"can't mount with dioread_nolock if filesystem block size %d != PAGE_SIZE",
> +				blocksize);
>  			return 0;
>  		}
>  	}
> @@ -3147,7 +3149,9 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
>  	ret = -EINVAL;
>  	blocksize = sb_min_blocksize(sb, EXT4_MIN_BLOCK_SIZE);
>  	if (!blocksize) {
> -		ext4_msg(sb, KERN_ERR, "unable to set blocksize");
> +		ext4_msg(sb, KERN_ERR,
> +			 "unable to set filesystem block size "
> +			 __stringify(EXT4_MIN_BLOCK_SIZE));
>  		goto out_fail;
>  	}
>  
> @@ -3367,14 +3371,15 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
>  	if (blocksize < EXT4_MIN_BLOCK_SIZE ||
>  	    blocksize > EXT4_MAX_BLOCK_SIZE) {
>  		ext4_msg(sb, KERN_ERR,
> -		       "Unsupported filesystem blocksize %d", blocksize);
> +			 "Unsupported filesystem block size %d", blocksize);
>  		goto failed_mount;
>  	}
>  
>  	if (sbi->s_mount_opt & EXT4_MOUNT_DAX) {
>  		if (blocksize != PAGE_SIZE) {
>  			ext4_msg(sb, KERN_ERR,
> -					"error: unsupported blocksize for dax");
> +			 "error: unsupported filesystem block size %d for dax",
> +				 blocksize);
>  			goto failed_mount;
>  		}
>  		if (!sb->s_bdev->bd_disk->fops->direct_access) {
> @@ -3393,7 +3398,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
>  	if (sb->s_blocksize != blocksize) {
>  		/* Validate the filesystem blocksize */
>  		if (!sb_set_blocksize(sb, blocksize)) {
> -			ext4_msg(sb, KERN_ERR, "bad block size %d",
> +			ext4_msg(sb, KERN_ERR, "bad filesystem block size %d",
>  					blocksize);
>  			goto failed_mount;
>  		}
> @@ -3495,8 +3500,8 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
>  	if (has_bigalloc) {
>  		if (clustersize < blocksize) {
>  			ext4_msg(sb, KERN_ERR,
> -				 "cluster size (%d) smaller than "
> -				 "block size (%d)", clustersize, blocksize);
> +		 "cluster size (%d) smaller than filesystem block size (%d)",
> +				clustersize, blocksize);
>  			goto failed_mount;
>  		}
>  		sbi->s_cluster_bits = le32_to_cpu(es->s_log_cluster_size) -
> @@ -3519,9 +3524,9 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
>  		}
>  	} else {
>  		if (clustersize != blocksize) {
> -			ext4_warning(sb, "fragment/cluster size (%d) != "
> -				     "block size (%d)", clustersize,
> -				     blocksize);
> +			ext4_warning(sb,
> +		 "fragment/cluster size (%d) != filesystem block size (%d)",
> +				     clustersize, blocksize);
>  			clustersize = blocksize;
>  		}
>  		if (sbi->s_blocks_per_group > blocksize * 8) {
> @@ -3769,7 +3774,8 @@ no_journal:
>  	if ((DUMMY_ENCRYPTION_ENABLED(sbi) || ext4_has_feature_encrypt(sb)) &&
>  	    (blocksize != PAGE_CACHE_SIZE)) {
>  		ext4_msg(sb, KERN_ERR,
> -			 "Unsupported blocksize for fs encryption");
> +		 "Unsupported filesystem block size %d for fs encryption",
> +			 blocksize);
>  		goto failed_mount_wq;
>  	}
>  
> @@ -4112,7 +4118,8 @@ static journal_t *ext4_get_dev_journal(struct super_block *sb,
>  	hblock = bdev_logical_block_size(bdev);
>  	if (blocksize < hblock) {
>  		ext4_msg(sb, KERN_ERR,
> -			"blocksize too small for journal device");
> +			"filesystem block size %d too small for journal device",
> +			blocksize);
>  		goto out_bdev;
>  	}
>  
> -- 
> 2.4.3
> 
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

      reply	other threads:[~2016-01-04  9:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-24  0:10 [PATCH] ext2, ext4: include filesystem block size in error messages Robert Elliott
2016-01-04  9:04 ` Jan Kara [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160104090444.GA3888@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=adilger.kernel@dilger.ca \
    --cc=choleraehyq@gmail.com \
    --cc=dan.j.williams@intel.com \
    --cc=david@fromorbit.com \
    --cc=elliott@hpe.com \
    --cc=jack@suse.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).