diff mbox

[v2,1/3] btrfs-progs: check: report more specific info about invalid location

Message ID 20171122021716.5957-1-suy.fnst@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Su Yue Nov. 22, 2017, 2:17 a.m. UTC
Previously, it was so useless to print message like
"invalid location %d".

Let it print objectid and offset of dir_item too.
Debug is easier now.

Suggested-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Su Yue <suy.fnst@cn.fujitsu.com>
---
changelog:
v2:
	Print unknown location type.
---
 cmds-check.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Nikolay Borisov Nov. 22, 2017, 7:06 a.m. UTC | #1
On 22.11.2017 04:17, Su Yue wrote:
> Previously, it was so useless to print message like
> "invalid location %d".
> 
> Let it print objectid and offset of dir_item too.
> Debug is easier now.
> 
> Suggested-by: Nikolay Borisov <nborisov@suse.com>
> Signed-off-by: Su Yue <suy.fnst@cn.fujitsu.com>


Reviewed-by: Nikolay Borisov <nborisov@suse.com>

> ---
> changelog:
> v2:
> 	Print unknown location type.
> ---
>  cmds-check.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/cmds-check.c b/cmds-check.c
> index a93ac2c88a38..416a7601bce1 100644
> --- a/cmds-check.c
> +++ b/cmds-check.c
> @@ -1635,8 +1635,9 @@ static int process_dir_item(struct extent_buffer *eb,
>  					  namebuf, len, filetype,
>  					  key->type, error);
>  		} else {
> -			fprintf(stderr, "invalid location in dir item %u\n",
> -				location.type);
> +			fprintf(stderr,
> +				"Unknown location type %d in DIR_ITEM[%llu %llu]\n",
> +				location.type, key->objectid, key->offset);
>  			add_inode_backref(inode_cache, BTRFS_MULTIPLE_OBJECTIDS,
>  					  key->objectid, key->offset, namebuf,
>  					  len, filetype, key->type, error);
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Sterba Jan. 8, 2018, 7:04 p.m. UTC | #2
On Wed, Nov 22, 2017 at 09:06:55AM +0200, Nikolay Borisov wrote:
> 
> 
> On 22.11.2017 04:17, Su Yue wrote:
> > Previously, it was so useless to print message like
> > "invalid location %d".
> > 
> > Let it print objectid and offset of dir_item too.
> > Debug is easier now.
> > 
> > Suggested-by: Nikolay Borisov <nborisov@suse.com>
> > Signed-off-by: Su Yue <suy.fnst@cn.fujitsu.com>
> 
> Reviewed-by: Nikolay Borisov <nborisov@suse.com>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/cmds-check.c b/cmds-check.c
index a93ac2c88a38..416a7601bce1 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -1635,8 +1635,9 @@  static int process_dir_item(struct extent_buffer *eb,
 					  namebuf, len, filetype,
 					  key->type, error);
 		} else {
-			fprintf(stderr, "invalid location in dir item %u\n",
-				location.type);
+			fprintf(stderr,
+				"Unknown location type %d in DIR_ITEM[%llu %llu]\n",
+				location.type, key->objectid, key->offset);
 			add_inode_backref(inode_cache, BTRFS_MULTIPLE_OBJECTIDS,
 					  key->objectid, key->offset, namebuf,
 					  len, filetype, key->type, error);