Skip to contentSkip to conversation

pdc metadata bug fix

PATCH Applied NeilBrown 2 participants 3 messages Dec 11, 2009 – Dec 14, 2009 Device mapper

lore
Share & tools
lore

NeilBrown

author
#0 lore raw

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

author
#1 lore raw

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 *lc
 							break;
 
 					/* Memorize main metadata sector. */
-					} else if (!info->u32)
+					} else if (!info->u32) {
 						info->u32 = *s;
+						*offset = sub ? di->sectors - *s : *s;
+					}
+
 				}
 			}
 		}
#2 lore raw

Re: [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)
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 -2
@@ -202,8 +202,11 @@ pdc_read_metadata(struct lib_context *lc
 							break;
 
 					/* 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