pdc metadata bug fix
cover pdc metadata bug fix
Hi,
the follow patch fixes a bug with pdc metadata handling, as described in that patch.
I noted on reading the code that if pdc_read_metadata finds the metadata at and address listed in begin_sectors, info->u32 is set to an offset from the start of the device, rather than from the end, and then the use of info->u32 in setup_rd becomes incorrect.
I didn't try to fix this as I don't know all the implications of a 'begin_sectors' address being used.
Thanks,
NeilBrown
PATCH 1/1 Ensure metadata dump of pdc metadata has the correct offset.
a read_metadata function needds to set *offset so that file_metadata can create the correct xxx/dev-offset file. pdf_read_metadata does not set *offset.
This patch add the appropriate setting.
--- 1.0.0.rc16/lib/format/ataraid/pdc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
1.0.0.rc16/lib/format/ataraid/pdc.c +4 -1
@@ -202,8 +202,11 @@ pdc_read_metadata(struct lib_context *lcbreak ;/* Memorize main metadata sector. */ - }else if (!info->u32) + }else if (!info->u32) { info->u32 = *s; + *offset = sub ? di->sectors - *s : *s; + } + } } }
Heinz Mauelshagen
AppliedRe: [PATCH dmraid 1/1] Ensure metadata dump of pdc metadata has the correct offset.
Applied to the sources repository.
Thanks,
Heinz
Quoted 32 lines · NeilBrown
plain text document attachment (pdc-metadata-dump-fix)
aread_metadatafunction needds to set *offset so thatfile_metadatacan create the correct xxx/dev-offset file.pdf_read_metadatadoes not set *offset.This patch add the appropriate setting.
Signed-off-by NeilBrown <[email protected]>--- 1.0.0.rc16/lib/format/ataraid/pdc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)1.0.0.rc16/lib/format/ataraid/pdc.c +4
-2@@ -202,8 +202,11 @@ pdc_read_metadata(struct lib_context *lcbreak ;/* Memorize main metadata sector. */ - }else if (!info->u32) + }else if (!info->u32) { info->u32 = *s; + *offset = sub ? di->sectors - *s : *s; + } + } } } --dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel