All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] f2fs: Introduce some information prints in the mount path
@ 2012-12-22  3:08 Namjae Jeon
  2012-12-26  1:55 ` Jaegeuk Kim
  0 siblings, 1 reply; 8+ messages in thread
From: Namjae Jeon @ 2012-12-22  3:08 UTC (permalink / raw)
  To: jaegeuk.kim
  Cc: linux-fsdevel, linux-kernel, linux-f2fs-devel, Namjae Jeon,
	Namjae Jeon, Amit Sahrawat

From: Namjae Jeon <namjae.jeon@samsung.com>

Added few informative prints in the mount path, to convey proper error
in case of mount failure.

Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com>
---
 fs/f2fs/super.c |   46 ++++++++++++++++++++++++++++++++++++----------
 1 file changed, 36 insertions(+), 10 deletions(-)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index cf0ffb8..86f8549 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -342,19 +342,29 @@ static int sanity_check_raw_super(struct f2fs_super_block *raw_super)
 {
 	unsigned int blocksize;
 
-	if (F2FS_SUPER_MAGIC != le32_to_cpu(raw_super->magic))
+	if (F2FS_SUPER_MAGIC != le32_to_cpu(raw_super->magic)) {
+		pr_info("Magic Mismatch, valid(0x%x) - read(0x%x)\n",
+			F2FS_SUPER_MAGIC, le32_to_cpu(raw_super->magic));
 		return 1;
+	}
 
 	/* Currently, support only 4KB block size */
 	blocksize = 1 << le32_to_cpu(raw_super->log_blocksize);
-	if (blocksize != PAGE_CACHE_SIZE)
+	if (blocksize != PAGE_CACHE_SIZE) {
+		pr_info("Not valid blocksize (%u), supports only 4KB\n",
+			blocksize);
 		return 1;
+	}
 	if (le32_to_cpu(raw_super->log_sectorsize) !=
-					F2FS_LOG_SECTOR_SIZE)
+					F2FS_LOG_SECTOR_SIZE) {
+		pr_info("Not valid log sectorsize\n");
 		return 1;
+	}
 	if (le32_to_cpu(raw_super->log_sectors_per_block) !=
-					F2FS_LOG_SECTORS_PER_BLOCK)
+					F2FS_LOG_SECTORS_PER_BLOCK) {
+			pr_info("Not valid log sectors per block\n");
 		return 1;
+	}
 	return 0;
 }
 
@@ -415,13 +425,16 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
 		return -ENOMEM;
 
 	/* set a temporary block size */
-	if (!sb_set_blocksize(sb, F2FS_BLKSIZE))
+	if (!sb_set_blocksize(sb, F2FS_BLKSIZE)) {
+		pr_err("unable to set blocksize\n");
 		goto free_sbi;
+	}
 
 	/* read f2fs raw super block */
 	raw_super_buf = sb_bread(sb, 0);
 	if (!raw_super_buf) {
 		err = -EIO;
+		pr_err("unable to read superblock\n");
 		goto free_sbi;
 	}
 	raw_super = (struct f2fs_super_block *)
@@ -443,8 +456,10 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
 		goto free_sb_buf;
 
 	/* sanity checking of raw super */
-	if (sanity_check_raw_super(raw_super))
+	if (sanity_check_raw_super(raw_super)) {
+		pr_err("Not a valid F2FS filesystem\n");
 		goto free_sb_buf;
+	}
 
 	sb->s_maxbytes = max_file_size(le32_to_cpu(raw_super->log_blocksize));
 	sb->s_max_links = F2FS_LINK_MAX;
@@ -478,18 +493,23 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
 	/* get an inode for meta space */
 	sbi->meta_inode = f2fs_iget(sb, F2FS_META_INO(sbi));
 	if (IS_ERR(sbi->meta_inode)) {
+		pr_err("Failed to read F2FS meta data inode\n");
 		err = PTR_ERR(sbi->meta_inode);
 		goto free_sb_buf;
 	}
 
 	err = get_valid_checkpoint(sbi);
-	if (err)
+	if (err) {
+		pr_err("Failed to get valid F2FS checkpoint\n");
 		goto free_meta_inode;
+	}
 
 	/* sanity checking of checkpoint */
 	err = -EINVAL;
-	if (sanity_check_ckpt(raw_super, sbi->ckpt))
+	if (sanity_check_ckpt(raw_super, sbi->ckpt)) {
+		pr_err("Not a valid F2FS checkpoint\n");
 		goto free_cp;
+	}
 
 	sbi->total_valid_node_count =
 				le32_to_cpu(sbi->ckpt->valid_node_count);
@@ -511,17 +531,22 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
 
 	/* setup f2fs internal modules */
 	err = build_segment_manager(sbi);
-	if (err)
+	if (err) {
+		pr_err("Failed to initialize F2FS segment manager\n");
 		goto free_sm;
+	}
 	err = build_node_manager(sbi);
-	if (err)
+	if (err) {
+		pr_err("Failed to initialize F2FS node manager\n");
 		goto free_nm;
+	}
 
 	build_gc_manager(sbi);
 
 	/* get an inode for node space */
 	sbi->node_inode = f2fs_iget(sb, F2FS_NODE_INO(sbi));
 	if (IS_ERR(sbi->node_inode)) {
+		pr_err("Failed to read node inode\n");
 		err = PTR_ERR(sbi->node_inode);
 		goto free_nm;
 	}
@@ -534,6 +559,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
 	/* read root inode and dentry */
 	root = f2fs_iget(sb, F2FS_ROOT_INO(sbi));
 	if (IS_ERR(root)) {
+		pr_err("Failed to read root inode\n");
 		err = PTR_ERR(root);
 		goto free_node_inode;
 	}
-- 
1.7.9.5


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

* Re: [PATCH 1/5] f2fs: Introduce some information prints in the mount path
  2012-12-22  3:08 [PATCH 1/5] f2fs: Introduce some information prints in the mount path Namjae Jeon
@ 2012-12-26  1:55 ` Jaegeuk Kim
  2012-12-26  2:10     ` Namjae Jeon
  0 siblings, 1 reply; 8+ messages in thread
From: Jaegeuk Kim @ 2012-12-26  1:55 UTC (permalink / raw)
  To: Namjae Jeon
  Cc: linux-fsdevel, linux-kernel, linux-f2fs-devel, Namjae Jeon,
	Amit Sahrawat

[-- Attachment #1: Type: text/plain, Size: 4847 bytes --]

Hi,

Could you make them follow the file system convention?
Something like "F2FS: blah blah~".

Otherwise, how about adding a debugging function to express the prefix?
Thanks,

2012-12-22 (토), 12:08 +0900, Namjae Jeon:
> From: Namjae Jeon <namjae.jeon@samsung.com>
> 
> Added few informative prints in the mount path, to convey proper error
> in case of mount failure.
> 
> Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
> Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com>
> ---
>  fs/f2fs/super.c |   46 ++++++++++++++++++++++++++++++++++++----------
>  1 file changed, 36 insertions(+), 10 deletions(-)
> 
> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
> index cf0ffb8..86f8549 100644
> --- a/fs/f2fs/super.c
> +++ b/fs/f2fs/super.c
> @@ -342,19 +342,29 @@ static int sanity_check_raw_super(struct f2fs_super_block *raw_super)
>  {
>  	unsigned int blocksize;
>  
> -	if (F2FS_SUPER_MAGIC != le32_to_cpu(raw_super->magic))
> +	if (F2FS_SUPER_MAGIC != le32_to_cpu(raw_super->magic)) {
> +		pr_info("Magic Mismatch, valid(0x%x) - read(0x%x)\n",
> +			F2FS_SUPER_MAGIC, le32_to_cpu(raw_super->magic));
>  		return 1;
> +	}
>  
>  	/* Currently, support only 4KB block size */
>  	blocksize = 1 << le32_to_cpu(raw_super->log_blocksize);
> -	if (blocksize != PAGE_CACHE_SIZE)
> +	if (blocksize != PAGE_CACHE_SIZE) {
> +		pr_info("Not valid blocksize (%u), supports only 4KB\n",
> +			blocksize);
>  		return 1;
> +	}
>  	if (le32_to_cpu(raw_super->log_sectorsize) !=
> -					F2FS_LOG_SECTOR_SIZE)
> +					F2FS_LOG_SECTOR_SIZE) {
> +		pr_info("Not valid log sectorsize\n");
>  		return 1;
> +	}
>  	if (le32_to_cpu(raw_super->log_sectors_per_block) !=
> -					F2FS_LOG_SECTORS_PER_BLOCK)
> +					F2FS_LOG_SECTORS_PER_BLOCK) {
> +			pr_info("Not valid log sectors per block\n");
>  		return 1;
> +	}
>  	return 0;
>  }
>  
> @@ -415,13 +425,16 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
>  		return -ENOMEM;
>  
>  	/* set a temporary block size */
> -	if (!sb_set_blocksize(sb, F2FS_BLKSIZE))
> +	if (!sb_set_blocksize(sb, F2FS_BLKSIZE)) {
> +		pr_err("unable to set blocksize\n");
>  		goto free_sbi;
> +	}
>  
>  	/* read f2fs raw super block */
>  	raw_super_buf = sb_bread(sb, 0);
>  	if (!raw_super_buf) {
>  		err = -EIO;
> +		pr_err("unable to read superblock\n");
>  		goto free_sbi;
>  	}
>  	raw_super = (struct f2fs_super_block *)
> @@ -443,8 +456,10 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
>  		goto free_sb_buf;
>  
>  	/* sanity checking of raw super */
> -	if (sanity_check_raw_super(raw_super))
> +	if (sanity_check_raw_super(raw_super)) {
> +		pr_err("Not a valid F2FS filesystem\n");
>  		goto free_sb_buf;
> +	}
>  
>  	sb->s_maxbytes = max_file_size(le32_to_cpu(raw_super->log_blocksize));
>  	sb->s_max_links = F2FS_LINK_MAX;
> @@ -478,18 +493,23 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
>  	/* get an inode for meta space */
>  	sbi->meta_inode = f2fs_iget(sb, F2FS_META_INO(sbi));
>  	if (IS_ERR(sbi->meta_inode)) {
> +		pr_err("Failed to read F2FS meta data inode\n");
>  		err = PTR_ERR(sbi->meta_inode);
>  		goto free_sb_buf;
>  	}
>  
>  	err = get_valid_checkpoint(sbi);
> -	if (err)
> +	if (err) {
> +		pr_err("Failed to get valid F2FS checkpoint\n");
>  		goto free_meta_inode;
> +	}
>  
>  	/* sanity checking of checkpoint */
>  	err = -EINVAL;
> -	if (sanity_check_ckpt(raw_super, sbi->ckpt))
> +	if (sanity_check_ckpt(raw_super, sbi->ckpt)) {
> +		pr_err("Not a valid F2FS checkpoint\n");
>  		goto free_cp;
> +	}
>  
>  	sbi->total_valid_node_count =
>  				le32_to_cpu(sbi->ckpt->valid_node_count);
> @@ -511,17 +531,22 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
>  
>  	/* setup f2fs internal modules */
>  	err = build_segment_manager(sbi);
> -	if (err)
> +	if (err) {
> +		pr_err("Failed to initialize F2FS segment manager\n");
>  		goto free_sm;
> +	}
>  	err = build_node_manager(sbi);
> -	if (err)
> +	if (err) {
> +		pr_err("Failed to initialize F2FS node manager\n");
>  		goto free_nm;
> +	}
>  
>  	build_gc_manager(sbi);
>  
>  	/* get an inode for node space */
>  	sbi->node_inode = f2fs_iget(sb, F2FS_NODE_INO(sbi));
>  	if (IS_ERR(sbi->node_inode)) {
> +		pr_err("Failed to read node inode\n");
>  		err = PTR_ERR(sbi->node_inode);
>  		goto free_nm;
>  	}
> @@ -534,6 +559,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
>  	/* read root inode and dentry */
>  	root = f2fs_iget(sb, F2FS_ROOT_INO(sbi));
>  	if (IS_ERR(root)) {
> +		pr_err("Failed to read root inode\n");
>  		err = PTR_ERR(root);
>  		goto free_node_inode;
>  	}

-- 
Jaegeuk Kim
Samsung

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 1/5] f2fs: Introduce some information prints in the mount path
  2012-12-26  1:55 ` Jaegeuk Kim
@ 2012-12-26  2:10     ` Namjae Jeon
  0 siblings, 0 replies; 8+ messages in thread
From: Namjae Jeon @ 2012-12-26  2:10 UTC (permalink / raw)
  To: jaegeuk.kim
  Cc: linux-fsdevel, linux-kernel, linux-f2fs-devel, Namjae Jeon,
	Amit Sahrawat

2012/12/26, Jaegeuk Kim <jaegeuk.kim@samsung.com>:
> Hi,
Hi Jaegeuk.
>
> Could you make them follow the file system convention?
> Something like "F2FS: blah blah~".
Yes,  I agree.

>
> Otherwise, how about adding a debugging function to express the prefix?
Okay, I will send you the patches included your suggestion.

Thanks.
> Thanks,
>
> 2012-12-22 (토), 12:08 +0900, Namjae Jeon:
>> From: Namjae Jeon <namjae.jeon@samsung.com>
>>
>> Added few informative prints in the mount path, to convey proper error
>> in case of mount failure.
>>
>> Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
>> Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com>
>> ---
>>  fs/f2fs/super.c |   46 ++++++++++++++++++++++++++++++++++++----------
>>  1 file changed, 36 insertions(+), 10 deletions(-)
>>
>> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
>> index cf0ffb8..86f8549 100644
>> --- a/fs/f2fs/super.c
>> +++ b/fs/f2fs/super.c
>> @@ -342,19 +342,29 @@ static int sanity_check_raw_super(struct
>> f2fs_super_block *raw_super)
>>  {
>>  	unsigned int blocksize;
>>
>> -	if (F2FS_SUPER_MAGIC != le32_to_cpu(raw_super->magic))
>> +	if (F2FS_SUPER_MAGIC != le32_to_cpu(raw_super->magic)) {
>> +		pr_info("Magic Mismatch, valid(0x%x) - read(0x%x)\n",
>> +			F2FS_SUPER_MAGIC, le32_to_cpu(raw_super->magic));
>>  		return 1;
>> +	}
>>
>>  	/* Currently, support only 4KB block size */
>>  	blocksize = 1 << le32_to_cpu(raw_super->log_blocksize);
>> -	if (blocksize != PAGE_CACHE_SIZE)
>> +	if (blocksize != PAGE_CACHE_SIZE) {
>> +		pr_info("Not valid blocksize (%u), supports only 4KB\n",
>> +			blocksize);
>>  		return 1;
>> +	}
>>  	if (le32_to_cpu(raw_super->log_sectorsize) !=
>> -					F2FS_LOG_SECTOR_SIZE)
>> +					F2FS_LOG_SECTOR_SIZE) {
>> +		pr_info("Not valid log sectorsize\n");
>>  		return 1;
>> +	}
>>  	if (le32_to_cpu(raw_super->log_sectors_per_block) !=
>> -					F2FS_LOG_SECTORS_PER_BLOCK)
>> +					F2FS_LOG_SECTORS_PER_BLOCK) {
>> +			pr_info("Not valid log sectors per block\n");
>>  		return 1;
>> +	}
>>  	return 0;
>>  }
>>
>> @@ -415,13 +425,16 @@ static int f2fs_fill_super(struct super_block *sb,
>> void *data, int silent)
>>  		return -ENOMEM;
>>
>>  	/* set a temporary block size */
>> -	if (!sb_set_blocksize(sb, F2FS_BLKSIZE))
>> +	if (!sb_set_blocksize(sb, F2FS_BLKSIZE)) {
>> +		pr_err("unable to set blocksize\n");
>>  		goto free_sbi;
>> +	}
>>
>>  	/* read f2fs raw super block */
>>  	raw_super_buf = sb_bread(sb, 0);
>>  	if (!raw_super_buf) {
>>  		err = -EIO;
>> +		pr_err("unable to read superblock\n");
>>  		goto free_sbi;
>>  	}
>>  	raw_super = (struct f2fs_super_block *)
>> @@ -443,8 +456,10 @@ static int f2fs_fill_super(struct super_block *sb,
>> void *data, int silent)
>>  		goto free_sb_buf;
>>
>>  	/* sanity checking of raw super */
>> -	if (sanity_check_raw_super(raw_super))
>> +	if (sanity_check_raw_super(raw_super)) {
>> +		pr_err("Not a valid F2FS filesystem\n");
>>  		goto free_sb_buf;
>> +	}
>>
>>  	sb->s_maxbytes = max_file_size(le32_to_cpu(raw_super->log_blocksize));
>>  	sb->s_max_links = F2FS_LINK_MAX;
>> @@ -478,18 +493,23 @@ static int f2fs_fill_super(struct super_block *sb,
>> void *data, int silent)
>>  	/* get an inode for meta space */
>>  	sbi->meta_inode = f2fs_iget(sb, F2FS_META_INO(sbi));
>>  	if (IS_ERR(sbi->meta_inode)) {
>> +		pr_err("Failed to read F2FS meta data inode\n");
>>  		err = PTR_ERR(sbi->meta_inode);
>>  		goto free_sb_buf;
>>  	}
>>
>>  	err = get_valid_checkpoint(sbi);
>> -	if (err)
>> +	if (err) {
>> +		pr_err("Failed to get valid F2FS checkpoint\n");
>>  		goto free_meta_inode;
>> +	}
>>
>>  	/* sanity checking of checkpoint */
>>  	err = -EINVAL;
>> -	if (sanity_check_ckpt(raw_super, sbi->ckpt))
>> +	if (sanity_check_ckpt(raw_super, sbi->ckpt)) {
>> +		pr_err("Not a valid F2FS checkpoint\n");
>>  		goto free_cp;
>> +	}
>>
>>  	sbi->total_valid_node_count =
>>  				le32_to_cpu(sbi->ckpt->valid_node_count);
>> @@ -511,17 +531,22 @@ static int f2fs_fill_super(struct super_block *sb,
>> void *data, int silent)
>>
>>  	/* setup f2fs internal modules */
>>  	err = build_segment_manager(sbi);
>> -	if (err)
>> +	if (err) {
>> +		pr_err("Failed to initialize F2FS segment manager\n");
>>  		goto free_sm;
>> +	}
>>  	err = build_node_manager(sbi);
>> -	if (err)
>> +	if (err) {
>> +		pr_err("Failed to initialize F2FS node manager\n");
>>  		goto free_nm;
>> +	}
>>
>>  	build_gc_manager(sbi);
>>
>>  	/* get an inode for node space */
>>  	sbi->node_inode = f2fs_iget(sb, F2FS_NODE_INO(sbi));
>>  	if (IS_ERR(sbi->node_inode)) {
>> +		pr_err("Failed to read node inode\n");
>>  		err = PTR_ERR(sbi->node_inode);
>>  		goto free_nm;
>>  	}
>> @@ -534,6 +559,7 @@ static int f2fs_fill_super(struct super_block *sb,
>> void *data, int silent)
>>  	/* read root inode and dentry */
>>  	root = f2fs_iget(sb, F2FS_ROOT_INO(sbi));
>>  	if (IS_ERR(root)) {
>> +		pr_err("Failed to read root inode\n");
>>  		err = PTR_ERR(root);
>>  		goto free_node_inode;
>>  	}
>
> --
> Jaegeuk Kim
> Samsung
>

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

* Re: [PATCH 1/5] f2fs: Introduce some information prints in the mount path
@ 2012-12-26  2:10     ` Namjae Jeon
  0 siblings, 0 replies; 8+ messages in thread
From: Namjae Jeon @ 2012-12-26  2:10 UTC (permalink / raw)
  To: jaegeuk.kim
  Cc: linux-fsdevel, linux-kernel, linux-f2fs-devel, Namjae Jeon,
	Amit Sahrawat

2012/12/26, Jaegeuk Kim <jaegeuk.kim@samsung.com>:
> Hi,
Hi Jaegeuk.
>
> Could you make them follow the file system convention?
> Something like "F2FS: blah blah~".
Yes,  I agree.

>
> Otherwise, how about adding a debugging function to express the prefix?
Okay, I will send you the patches included your suggestion.

Thanks.
> Thanks,
>
> 2012-12-22 (토), 12:08 +0900, Namjae Jeon:
>> From: Namjae Jeon <namjae.jeon@samsung.com>
>>
>> Added few informative prints in the mount path, to convey proper error
>> in case of mount failure.
>>
>> Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
>> Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com>
>> ---
>>  fs/f2fs/super.c |   46 ++++++++++++++++++++++++++++++++++++----------
>>  1 file changed, 36 insertions(+), 10 deletions(-)
>>
>> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
>> index cf0ffb8..86f8549 100644
>> --- a/fs/f2fs/super.c
>> +++ b/fs/f2fs/super.c
>> @@ -342,19 +342,29 @@ static int sanity_check_raw_super(struct
>> f2fs_super_block *raw_super)
>>  {
>>  	unsigned int blocksize;
>>
>> -	if (F2FS_SUPER_MAGIC != le32_to_cpu(raw_super->magic))
>> +	if (F2FS_SUPER_MAGIC != le32_to_cpu(raw_super->magic)) {
>> +		pr_info("Magic Mismatch, valid(0x%x) - read(0x%x)\n",
>> +			F2FS_SUPER_MAGIC, le32_to_cpu(raw_super->magic));
>>  		return 1;
>> +	}
>>
>>  	/* Currently, support only 4KB block size */
>>  	blocksize = 1 << le32_to_cpu(raw_super->log_blocksize);
>> -	if (blocksize != PAGE_CACHE_SIZE)
>> +	if (blocksize != PAGE_CACHE_SIZE) {
>> +		pr_info("Not valid blocksize (%u), supports only 4KB\n",
>> +			blocksize);
>>  		return 1;
>> +	}
>>  	if (le32_to_cpu(raw_super->log_sectorsize) !=
>> -					F2FS_LOG_SECTOR_SIZE)
>> +					F2FS_LOG_SECTOR_SIZE) {
>> +		pr_info("Not valid log sectorsize\n");
>>  		return 1;
>> +	}
>>  	if (le32_to_cpu(raw_super->log_sectors_per_block) !=
>> -					F2FS_LOG_SECTORS_PER_BLOCK)
>> +					F2FS_LOG_SECTORS_PER_BLOCK) {
>> +			pr_info("Not valid log sectors per block\n");
>>  		return 1;
>> +	}
>>  	return 0;
>>  }
>>
>> @@ -415,13 +425,16 @@ static int f2fs_fill_super(struct super_block *sb,
>> void *data, int silent)
>>  		return -ENOMEM;
>>
>>  	/* set a temporary block size */
>> -	if (!sb_set_blocksize(sb, F2FS_BLKSIZE))
>> +	if (!sb_set_blocksize(sb, F2FS_BLKSIZE)) {
>> +		pr_err("unable to set blocksize\n");
>>  		goto free_sbi;
>> +	}
>>
>>  	/* read f2fs raw super block */
>>  	raw_super_buf = sb_bread(sb, 0);
>>  	if (!raw_super_buf) {
>>  		err = -EIO;
>> +		pr_err("unable to read superblock\n");
>>  		goto free_sbi;
>>  	}
>>  	raw_super = (struct f2fs_super_block *)
>> @@ -443,8 +456,10 @@ static int f2fs_fill_super(struct super_block *sb,
>> void *data, int silent)
>>  		goto free_sb_buf;
>>
>>  	/* sanity checking of raw super */
>> -	if (sanity_check_raw_super(raw_super))
>> +	if (sanity_check_raw_super(raw_super)) {
>> +		pr_err("Not a valid F2FS filesystem\n");
>>  		goto free_sb_buf;
>> +	}
>>
>>  	sb->s_maxbytes = max_file_size(le32_to_cpu(raw_super->log_blocksize));
>>  	sb->s_max_links = F2FS_LINK_MAX;
>> @@ -478,18 +493,23 @@ static int f2fs_fill_super(struct super_block *sb,
>> void *data, int silent)
>>  	/* get an inode for meta space */
>>  	sbi->meta_inode = f2fs_iget(sb, F2FS_META_INO(sbi));
>>  	if (IS_ERR(sbi->meta_inode)) {
>> +		pr_err("Failed to read F2FS meta data inode\n");
>>  		err = PTR_ERR(sbi->meta_inode);
>>  		goto free_sb_buf;
>>  	}
>>
>>  	err = get_valid_checkpoint(sbi);
>> -	if (err)
>> +	if (err) {
>> +		pr_err("Failed to get valid F2FS checkpoint\n");
>>  		goto free_meta_inode;
>> +	}
>>
>>  	/* sanity checking of checkpoint */
>>  	err = -EINVAL;
>> -	if (sanity_check_ckpt(raw_super, sbi->ckpt))
>> +	if (sanity_check_ckpt(raw_super, sbi->ckpt)) {
>> +		pr_err("Not a valid F2FS checkpoint\n");
>>  		goto free_cp;
>> +	}
>>
>>  	sbi->total_valid_node_count =
>>  				le32_to_cpu(sbi->ckpt->valid_node_count);
>> @@ -511,17 +531,22 @@ static int f2fs_fill_super(struct super_block *sb,
>> void *data, int silent)
>>
>>  	/* setup f2fs internal modules */
>>  	err = build_segment_manager(sbi);
>> -	if (err)
>> +	if (err) {
>> +		pr_err("Failed to initialize F2FS segment manager\n");
>>  		goto free_sm;
>> +	}
>>  	err = build_node_manager(sbi);
>> -	if (err)
>> +	if (err) {
>> +		pr_err("Failed to initialize F2FS node manager\n");
>>  		goto free_nm;
>> +	}
>>
>>  	build_gc_manager(sbi);
>>
>>  	/* get an inode for node space */
>>  	sbi->node_inode = f2fs_iget(sb, F2FS_NODE_INO(sbi));
>>  	if (IS_ERR(sbi->node_inode)) {
>> +		pr_err("Failed to read node inode\n");
>>  		err = PTR_ERR(sbi->node_inode);
>>  		goto free_nm;
>>  	}
>> @@ -534,6 +559,7 @@ static int f2fs_fill_super(struct super_block *sb,
>> void *data, int silent)
>>  	/* read root inode and dentry */
>>  	root = f2fs_iget(sb, F2FS_ROOT_INO(sbi));
>>  	if (IS_ERR(root)) {
>> +		pr_err("Failed to read root inode\n");
>>  		err = PTR_ERR(root);
>>  		goto free_node_inode;
>>  	}
>
> --
> Jaegeuk Kim
> Samsung
>
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 1/5] f2fs: Introduce some information prints in the mount path
  2012-12-26  2:10     ` Namjae Jeon
  (?)
@ 2012-12-26  2:14     ` Joe Perches
  2012-12-26  4:22       ` Namjae Jeon
  -1 siblings, 1 reply; 8+ messages in thread
From: Joe Perches @ 2012-12-26  2:14 UTC (permalink / raw)
  To: Namjae Jeon
  Cc: jaegeuk.kim, linux-fsdevel, linux-kernel, linux-f2fs-devel,
	Namjae Jeon, Amit Sahrawat

On Wed, 2012-12-26 at 11:10 +0900, Namjae Jeon wrote:
> 2012/12/26, Jaegeuk Kim <jaegeuk.kim@samsung.com>:
> > Hi,
> Hi Jaegeuk.
> >
> > Could you make them follow the file system convention?
> > Something like "F2FS: blah blah~".
> Yes,  I agree.
> 
> >
> > Otherwise, how about adding a debugging function to express the prefix?
> Okay, I will send you the patches included your suggestion.

Add

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

before any #include


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

* Re: [PATCH 1/5] f2fs: Introduce some information prints in the mount path
  2012-12-26  2:14     ` Joe Perches
@ 2012-12-26  4:22       ` Namjae Jeon
  2012-12-26  8:17         ` Joe Perches
  0 siblings, 1 reply; 8+ messages in thread
From: Namjae Jeon @ 2012-12-26  4:22 UTC (permalink / raw)
  To: Joe Perches
  Cc: jaegeuk.kim, linux-fsdevel, linux-kernel, linux-f2fs-devel,
	Namjae Jeon, Amit Sahrawat

2012/12/26, Joe Perches <joe@perches.com>:
> On Wed, 2012-12-26 at 11:10 +0900, Namjae Jeon wrote:
>> 2012/12/26, Jaegeuk Kim <jaegeuk.kim@samsung.com>:
>> > Hi,
>> Hi Jaegeuk.
>> >
>> > Could you make them follow the file system convention?
>> > Something like "F2FS: blah blah~".
>> Yes,  I agree.
>>
>> >
>> > Otherwise, how about adding a debugging function to express the prefix?
>> Okay, I will send you the patches included your suggestion.
>
> Add
>
> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>
> before any #include
Hi Joe.

I think we can have debugging message function for f2fs similar to
ext4/fat like fat_msg, ext4_msg.
It is one time change but in the future it will allow more convenience
to use that way.
What is your opinion ?

Or is that we have to to use pr_xxx function for error print instead
of own print debug function ?
	
Thanks.

>
>

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

* Re: [PATCH 1/5] f2fs: Introduce some information prints in the mount path
  2012-12-26  4:22       ` Namjae Jeon
@ 2012-12-26  8:17         ` Joe Perches
  2012-12-26  9:12           ` Namjae Jeon
  0 siblings, 1 reply; 8+ messages in thread
From: Joe Perches @ 2012-12-26  8:17 UTC (permalink / raw)
  To: Namjae Jeon
  Cc: jaegeuk.kim, linux-fsdevel, linux-kernel, linux-f2fs-devel,
	Namjae Jeon, Amit Sahrawat

On Wed, 2012-12-26 at 13:22 +0900, Namjae Jeon wrote:
> 2012/12/26, Joe Perches <joe@perches.com>:
> > On Wed, 2012-12-26 at 11:10 +0900, Namjae Jeon wrote:
> >> 2012/12/26, Jaegeuk Kim <jaegeuk.kim@samsung.com>:
> >> > Could you make them follow the file system convention?
> >> > Something like "F2FS: blah blah~".
> >> Yes,  I agree.
> >> > Otherwise, how about adding a debugging function to express the prefix?
> >> Okay, I will send you the patches included your suggestion.
> > Add
> > #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> > before any #include
> Hi Joe.

Hello Namjae

> I think we can have debugging message function for f2fs similar to
> ext4/fat like fat_msg, ext4_msg.
> It is one time change but in the future it will allow more convenience
> to use that way.
> What is your opinion ?
> 
> Or is that we have to to use pr_xxx function for error print instead
> of own print debug function ?

Sure, make your own f2fs_dbg function/macro when
and if you have an object you want to pass along
with the format and args

something like:

fs2fs_printk(struct fs2fs_handle *f2h, const char *fmt, ...)

Otherwise, just use pr_debug/pr_<level>(fmt, ...)

cheers, Joe


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

* Re: [PATCH 1/5] f2fs: Introduce some information prints in the mount path
  2012-12-26  8:17         ` Joe Perches
@ 2012-12-26  9:12           ` Namjae Jeon
  0 siblings, 0 replies; 8+ messages in thread
From: Namjae Jeon @ 2012-12-26  9:12 UTC (permalink / raw)
  To: Joe Perches
  Cc: jaegeuk.kim, linux-fsdevel, linux-kernel, linux-f2fs-devel,
	Namjae Jeon, Amit Sahrawat

2012/12/26, Joe Perches <joe@perches.com>:
> On Wed, 2012-12-26 at 13:22 +0900, Namjae Jeon wrote:
>> 2012/12/26, Joe Perches <joe@perches.com>:
>> > On Wed, 2012-12-26 at 11:10 +0900, Namjae Jeon wrote:
>> >> 2012/12/26, Jaegeuk Kim <jaegeuk.kim@samsung.com>:
>> >> > Could you make them follow the file system convention?
>> >> > Something like "F2FS: blah blah~".
>> >> Yes,  I agree.
>> >> > Otherwise, how about adding a debugging function to express the
>> >> > prefix?
>> >> Okay, I will send you the patches included your suggestion.
>> > Add
>> > #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>> > before any #include
>> Hi Joe.
>
> Hello Namjae
>
>> I think we can have debugging message function for f2fs similar to
>> ext4/fat like fat_msg, ext4_msg.
>> It is one time change but in the future it will allow more convenience
>> to use that way.
>> What is your opinion ?
>>
>> Or is that we have to to use pr_xxx function for error print instead
>> of own print debug function ?
>
> Sure, make your own f2fs_dbg function/macro when
> and if you have an object you want to pass along
> with the format and args
>
> something like:
>
> fs2fs_printk(struct fs2fs_handle *f2h, const char *fmt, ...)
>
> Otherwise, just use pr_debug/pr_<level>(fmt, ...)
Okay, Thanks for reply!

>
> cheers, Joe
>
>

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

end of thread, other threads:[~2012-12-26  9:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-22  3:08 [PATCH 1/5] f2fs: Introduce some information prints in the mount path Namjae Jeon
2012-12-26  1:55 ` Jaegeuk Kim
2012-12-26  2:10   ` Namjae Jeon
2012-12-26  2:10     ` Namjae Jeon
2012-12-26  2:14     ` Joe Perches
2012-12-26  4:22       ` Namjae Jeon
2012-12-26  8:17         ` Joe Perches
2012-12-26  9:12           ` Namjae Jeon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.