All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH dmraid 0/1] pdc metadata bug fix
@ 2009-12-11  3:27 NeilBrown
  2009-12-11  3:27 ` [PATCH dmraid 1/1] Ensure metadata dump of pdc metadata has the correct offset NeilBrown
  0 siblings, 1 reply; 3+ messages in thread
From: NeilBrown @ 2009-12-11  3:27 UTC (permalink / raw)
  To: dm-devel


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

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

* [PATCH dmraid 1/1] Ensure metadata dump of pdc metadata has the correct offset.
  2009-12-11  3:27 [PATCH dmraid 0/1] pdc metadata bug fix NeilBrown
@ 2009-12-11  3:27 ` NeilBrown
  2009-12-14 14:35   ` Heinz Mauelshagen
  0 siblings, 1 reply; 3+ messages in thread
From: NeilBrown @ 2009-12-11  3:27 UTC (permalink / raw)
  To: dm-devel

[-- Attachment #1: pdc-metadata-dump-fix --]
[-- Type: text/plain, Size: 717 bytes --]

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.

Signed-off-by: NeilBrown <neilb@suse.de>
---
 1.0.0.rc16/lib/format/ataraid/pdc.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- dmraid.orig/1.0.0.rc16/lib/format/ataraid/pdc.c
+++ dmraid/1.0.0.rc16/lib/format/ataraid/pdc.c
@@ -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;
+					}
+
 				}
 			}
 		}

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

* Re: [PATCH dmraid 1/1] Ensure metadata dump of pdc metadata has the correct offset.
  2009-12-11  3:27 ` [PATCH dmraid 1/1] Ensure metadata dump of pdc metadata has the correct offset NeilBrown
@ 2009-12-14 14:35   ` Heinz Mauelshagen
  0 siblings, 0 replies; 3+ messages in thread
From: Heinz Mauelshagen @ 2009-12-14 14:35 UTC (permalink / raw)
  To: device-mapper development


Applied to the sources repository.

Thanks,
Heinz

On Fri, 2009-12-11 at 14:27 +1100, NeilBrown wrote:
> 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.
> 
> Signed-off-by: NeilBrown <neilb@suse.de>
> ---
>  1.0.0.rc16/lib/format/ataraid/pdc.c |    5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> --- dmraid.orig/1.0.0.rc16/lib/format/ataraid/pdc.c
> +++ dmraid/1.0.0.rc16/lib/format/ataraid/pdc.c
> @@ -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
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel

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

end of thread, other threads:[~2009-12-14 14:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-11  3:27 [PATCH dmraid 0/1] pdc metadata bug fix NeilBrown
2009-12-11  3:27 ` [PATCH dmraid 1/1] Ensure metadata dump of pdc metadata has the correct offset NeilBrown
2009-12-14 14:35   ` Heinz Mauelshagen

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.