[PATCH 1/5] metadump: sanitise write_buf/index return values

Mark Tinguely tinguely at sgi.com
Fri Feb 14 14:54:31 CST 2014


On 02/14/14 13:51, Mark Tinguely wrote:
> On 02/13/14 20:20, Dave Chinner wrote:
>> On Thu, Feb 13, 2014 at 01:30:00PM -0600, Mark Tinguely wrote:
>>> On 01/23/14 04:23, Dave Chinner wrote:
>>>> From: Dave Chinner<dchinner at redhat.com>
>>>>
>>>> Write_buf/write_index use confusing boolean values for return,
>>>> meaning that it's hard to tell what the correct error return is
>>>> supposed to be. Convert them to return zero on success or a
>>>> negative errno otherwise so that it's clear what the error case is.
>>>>
>>>> Signed-off-by: Dave Chinner<dchinner at redhat.com>
>>>> ---
>>>
>>> Looks like this patch broke metadumps on some corrupted filesystems.
>>> This is a legacy filesystem that has zeroes overwriting the
>>> SB/AGF/AGI on AG 1/2/3:
>>>
>>>
>>> # xfs_metadump -wgo /dev/sda8 myfile.metadata
>>> xfs_agf_read_verify: XFS_CORRUPTION_ERROR
>>> xfs_metadump: cannot init perag data (117). Continuing anyway.
>>> Copied 64 of 64 inodes (0 of 4 AGs) xfs_agf_write_verify: XF
>>> S_CORRUPTION_ERROR
>>> write_buf: write verifer failed on bno 0x1100919/0x200
>>> (no output)
>>
>> Where did it crash? Can you post the stack trace from gdb? Even
>> better, can you send a patch to fix the problem? ;)
>>
>> Cheers,
>>
>> Dave.
>
> No crash, just exits without performing the dump.
>
> --Mark.
>

The error from the verifier prevents the metadump from completing.
You will want to fix it another way...

--Mark.

---
  db/metadump.c |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Index: b/db/metadump.c
===================================================================
--- a/db/metadump.c
+++ b/db/metadump.c
@@ -209,7 +209,7 @@ write_buf(
  	_("%s: write verifer failed on bno 0x%llx/0x%x\n"),
  				__func__, (long long)buf->bp->b_bn,
  				buf->bp->b_bcount);
-			return -buf->bp->b_error;
+			return 0;
  		}
  	}



More information about the xfs mailing list