* [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
@ 2002-02-14 17:11 Alex Williamson
2002-02-14 17:11 ` Alex Williamson
` (37 more replies)
0 siblings, 38 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-14 17:11 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
I was testing w/ some disks that appear to have bad partition
tables and was getting the following error messages:
SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
Use GNU Parted to correct disk.
Unfortunately, that's not where the problem stopped. I got
random pointer dereference problems, and was apparently having
data structures freed out from under them. Turns out the
find_valid_gpt() was freeing data structures more than once and
passing back pointers to freed structures. Patch below.
Alex
--
Alex Williamson Linux Development Lab
alex_williamson@hp.com Hewlett Packard
970-898-9173 Fort Collins, CO
[-- Attachment #2: efi.diff --]
[-- Type: text/plain, Size: 692 bytes --]
--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2
+++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000
@@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc
*gpt = pgpt;
*ptes = pptes;
- if (agpt)
+ if (agpt) {
kfree(agpt);
- if (aptes)
+ agpt = NULL;
+ }
+ if (aptes) {
kfree(aptes);
+ aptes = NULL;
+ }
} /* if primary is valid */
else {
/* Primary GPT is bad, check the Alternate GPT */
@@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc
/* Both primary and alternate GPTs are bad, and/or PMBR is invalid.
* This isn't our disk, return 0.
*/
+ *gpt = *ptes = NULL;
+
if (pgpt) {
kfree(pgpt);
pgpt = NULL;
^ permalink raw reply [flat|nested] 39+ messages in thread
* [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (5 preceding siblings ...)
2002-02-14 17:11 ` Alex Williamson
@ 2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
` (30 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-14 17:11 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
I was testing w/ some disks that appear to have bad partition
tables and was getting the following error messages:
SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
Use GNU Parted to correct disk.
Unfortunately, that's not where the problem stopped. I got
random pointer dereference problems, and was apparently having
data structures freed out from under them. Turns out the
find_valid_gpt() was freeing data structures more than once and
passing back pointers to freed structures. Patch below.
Alex
--
Alex Williamson Linux Development Lab
alex_williamson@hp.com Hewlett Packard
970-898-9173 Fort Collins, CO
[-- Attachment #2: efi.diff --]
[-- Type: text/plain, Size: 692 bytes --]
--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2
+++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000
@@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc
*gpt = pgpt;
*ptes = pptes;
- if (agpt)
+ if (agpt) {
kfree(agpt);
- if (aptes)
+ agpt = NULL;
+ }
+ if (aptes) {
kfree(aptes);
+ aptes = NULL;
+ }
} /* if primary is valid */
else {
/* Primary GPT is bad, check the Alternate GPT */
@@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc
/* Both primary and alternate GPTs are bad, and/or PMBR is invalid.
* This isn't our disk, return 0.
*/
+ *gpt = *ptes = NULL;
+
if (pgpt) {
kfree(pgpt);
pgpt = NULL;
^ permalink raw reply [flat|nested] 39+ messages in thread
* [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (7 preceding siblings ...)
2002-02-14 17:11 ` Alex Williamson
@ 2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
` (28 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-14 17:11 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
I was testing w/ some disks that appear to have bad partition
tables and was getting the following error messages:
SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
Use GNU Parted to correct disk.
Unfortunately, that's not where the problem stopped. I got
random pointer dereference problems, and was apparently having
data structures freed out from under them. Turns out the
find_valid_gpt() was freeing data structures more than once and
passing back pointers to freed structures. Patch below.
Alex
--
Alex Williamson Linux Development Lab
alex_williamson@hp.com Hewlett Packard
970-898-9173 Fort Collins, CO
[-- Attachment #2: efi.diff --]
[-- Type: text/plain, Size: 692 bytes --]
--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2
+++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000
@@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc
*gpt = pgpt;
*ptes = pptes;
- if (agpt)
+ if (agpt) {
kfree(agpt);
- if (aptes)
+ agpt = NULL;
+ }
+ if (aptes) {
kfree(aptes);
+ aptes = NULL;
+ }
} /* if primary is valid */
else {
/* Primary GPT is bad, check the Alternate GPT */
@@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc
/* Both primary and alternate GPTs are bad, and/or PMBR is invalid.
* This isn't our disk, return 0.
*/
+ *gpt = *ptes = NULL;
+
if (pgpt) {
kfree(pgpt);
pgpt = NULL;
^ permalink raw reply [flat|nested] 39+ messages in thread
* [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (14 preceding siblings ...)
2002-02-14 17:11 ` Alex Williamson
@ 2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
` (21 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-14 17:11 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
I was testing w/ some disks that appear to have bad partition
tables and was getting the following error messages:
SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
Use GNU Parted to correct disk.
Unfortunately, that's not where the problem stopped. I got
random pointer dereference problems, and was apparently having
data structures freed out from under them. Turns out the
find_valid_gpt() was freeing data structures more than once and
passing back pointers to freed structures. Patch below.
Alex
--
Alex Williamson Linux Development Lab
alex_williamson@hp.com Hewlett Packard
970-898-9173 Fort Collins, CO
[-- Attachment #2: efi.diff --]
[-- Type: text/plain, Size: 692 bytes --]
--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2
+++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000
@@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc
*gpt = pgpt;
*ptes = pptes;
- if (agpt)
+ if (agpt) {
kfree(agpt);
- if (aptes)
+ agpt = NULL;
+ }
+ if (aptes) {
kfree(aptes);
+ aptes = NULL;
+ }
} /* if primary is valid */
else {
/* Primary GPT is bad, check the Alternate GPT */
@@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc
/* Both primary and alternate GPTs are bad, and/or PMBR is invalid.
* This isn't our disk, return 0.
*/
+ *gpt = *ptes = NULL;
+
if (pgpt) {
kfree(pgpt);
pgpt = NULL;
^ permalink raw reply [flat|nested] 39+ messages in thread
* [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
@ 2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
` (34 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-14 17:11 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
I was testing w/ some disks that appear to have bad partition
tables and was getting the following error messages:
SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
Use GNU Parted to correct disk.
Unfortunately, that's not where the problem stopped. I got
random pointer dereference problems, and was apparently having
data structures freed out from under them. Turns out the
find_valid_gpt() was freeing data structures more than once and
passing back pointers to freed structures. Patch below.
Alex
--
Alex Williamson Linux Development Lab
alex_williamson@hp.com Hewlett Packard
970-898-9173 Fort Collins, CO
[-- Attachment #2: efi.diff --]
[-- Type: text/plain, Size: 692 bytes --]
--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2
+++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000
@@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc
*gpt = pgpt;
*ptes = pptes;
- if (agpt)
+ if (agpt) {
kfree(agpt);
- if (aptes)
+ agpt = NULL;
+ }
+ if (aptes) {
kfree(aptes);
+ aptes = NULL;
+ }
} /* if primary is valid */
else {
/* Primary GPT is bad, check the Alternate GPT */
@@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc
/* Both primary and alternate GPTs are bad, and/or PMBR is invalid.
* This isn't our disk, return 0.
*/
+ *gpt = *ptes = NULL;
+
if (pgpt) {
kfree(pgpt);
pgpt = NULL;
^ permalink raw reply [flat|nested] 39+ messages in thread
* [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (11 preceding siblings ...)
2002-02-14 17:11 ` Alex Williamson
@ 2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
` (24 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-14 17:11 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
I was testing w/ some disks that appear to have bad partition
tables and was getting the following error messages:
SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
Use GNU Parted to correct disk.
Unfortunately, that's not where the problem stopped. I got
random pointer dereference problems, and was apparently having
data structures freed out from under them. Turns out the
find_valid_gpt() was freeing data structures more than once and
passing back pointers to freed structures. Patch below.
Alex
--
Alex Williamson Linux Development Lab
alex_williamson@hp.com Hewlett Packard
970-898-9173 Fort Collins, CO
[-- Attachment #2: efi.diff --]
[-- Type: text/plain, Size: 692 bytes --]
--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2
+++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000
@@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc
*gpt = pgpt;
*ptes = pptes;
- if (agpt)
+ if (agpt) {
kfree(agpt);
- if (aptes)
+ agpt = NULL;
+ }
+ if (aptes) {
kfree(aptes);
+ aptes = NULL;
+ }
} /* if primary is valid */
else {
/* Primary GPT is bad, check the Alternate GPT */
@@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc
/* Both primary and alternate GPTs are bad, and/or PMBR is invalid.
* This isn't our disk, return 0.
*/
+ *gpt = *ptes = NULL;
+
if (pgpt) {
kfree(pgpt);
pgpt = NULL;
^ permalink raw reply [flat|nested] 39+ messages in thread
* [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (29 preceding siblings ...)
2002-02-14 17:11 ` Alex Williamson
@ 2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
` (6 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-14 17:11 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
I was testing w/ some disks that appear to have bad partition
tables and was getting the following error messages:
SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
Use GNU Parted to correct disk.
Unfortunately, that's not where the problem stopped. I got
random pointer dereference problems, and was apparently having
data structures freed out from under them. Turns out the
find_valid_gpt() was freeing data structures more than once and
passing back pointers to freed structures. Patch below.
Alex
--
Alex Williamson Linux Development Lab
alex_williamson@hp.com Hewlett Packard
970-898-9173 Fort Collins, CO
[-- Attachment #2: efi.diff --]
[-- Type: text/plain, Size: 692 bytes --]
--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2
+++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000
@@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc
*gpt = pgpt;
*ptes = pptes;
- if (agpt)
+ if (agpt) {
kfree(agpt);
- if (aptes)
+ agpt = NULL;
+ }
+ if (aptes) {
kfree(aptes);
+ aptes = NULL;
+ }
} /* if primary is valid */
else {
/* Primary GPT is bad, check the Alternate GPT */
@@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc
/* Both primary and alternate GPTs are bad, and/or PMBR is invalid.
* This isn't our disk, return 0.
*/
+ *gpt = *ptes = NULL;
+
if (pgpt) {
kfree(pgpt);
pgpt = NULL;
^ permalink raw reply [flat|nested] 39+ messages in thread
* [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (16 preceding siblings ...)
2002-02-14 17:11 ` Alex Williamson
@ 2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
` (19 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-14 17:11 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
I was testing w/ some disks that appear to have bad partition
tables and was getting the following error messages:
SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
Use GNU Parted to correct disk.
Unfortunately, that's not where the problem stopped. I got
random pointer dereference problems, and was apparently having
data structures freed out from under them. Turns out the
find_valid_gpt() was freeing data structures more than once and
passing back pointers to freed structures. Patch below.
Alex
--
Alex Williamson Linux Development Lab
alex_williamson@hp.com Hewlett Packard
970-898-9173 Fort Collins, CO
[-- Attachment #2: efi.diff --]
[-- Type: text/plain, Size: 692 bytes --]
--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2
+++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000
@@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc
*gpt = pgpt;
*ptes = pptes;
- if (agpt)
+ if (agpt) {
kfree(agpt);
- if (aptes)
+ agpt = NULL;
+ }
+ if (aptes) {
kfree(aptes);
+ aptes = NULL;
+ }
} /* if primary is valid */
else {
/* Primary GPT is bad, check the Alternate GPT */
@@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc
/* Both primary and alternate GPTs are bad, and/or PMBR is invalid.
* This isn't our disk, return 0.
*/
+ *gpt = *ptes = NULL;
+
if (pgpt) {
kfree(pgpt);
pgpt = NULL;
^ permalink raw reply [flat|nested] 39+ messages in thread
* [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
@ 2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
` (36 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-14 17:11 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
I was testing w/ some disks that appear to have bad partition
tables and was getting the following error messages:
SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
Use GNU Parted to correct disk.
Unfortunately, that's not where the problem stopped. I got
random pointer dereference problems, and was apparently having
data structures freed out from under them. Turns out the
find_valid_gpt() was freeing data structures more than once and
passing back pointers to freed structures. Patch below.
Alex
--
Alex Williamson Linux Development Lab
alex_williamson@hp.com Hewlett Packard
970-898-9173 Fort Collins, CO
[-- Attachment #2: efi.diff --]
[-- Type: text/plain, Size: 692 bytes --]
--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2
+++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000
@@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc
*gpt = pgpt;
*ptes = pptes;
- if (agpt)
+ if (agpt) {
kfree(agpt);
- if (aptes)
+ agpt = NULL;
+ }
+ if (aptes) {
kfree(aptes);
+ aptes = NULL;
+ }
} /* if primary is valid */
else {
/* Primary GPT is bad, check the Alternate GPT */
@@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc
/* Both primary and alternate GPTs are bad, and/or PMBR is invalid.
* This isn't our disk, return 0.
*/
+ *gpt = *ptes = NULL;
+
if (pgpt) {
kfree(pgpt);
pgpt = NULL;
^ permalink raw reply [flat|nested] 39+ messages in thread
* [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (18 preceding siblings ...)
2002-02-14 17:11 ` Alex Williamson
@ 2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
` (17 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-14 17:11 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
I was testing w/ some disks that appear to have bad partition
tables and was getting the following error messages:
SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
Use GNU Parted to correct disk.
Unfortunately, that's not where the problem stopped. I got
random pointer dereference problems, and was apparently having
data structures freed out from under them. Turns out the
find_valid_gpt() was freeing data structures more than once and
passing back pointers to freed structures. Patch below.
Alex
--
Alex Williamson Linux Development Lab
alex_williamson@hp.com Hewlett Packard
970-898-9173 Fort Collins, CO
[-- Attachment #2: efi.diff --]
[-- Type: text/plain, Size: 692 bytes --]
--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2
+++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000
@@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc
*gpt = pgpt;
*ptes = pptes;
- if (agpt)
+ if (agpt) {
kfree(agpt);
- if (aptes)
+ agpt = NULL;
+ }
+ if (aptes) {
kfree(aptes);
+ aptes = NULL;
+ }
} /* if primary is valid */
else {
/* Primary GPT is bad, check the Alternate GPT */
@@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc
/* Both primary and alternate GPTs are bad, and/or PMBR is invalid.
* This isn't our disk, return 0.
*/
+ *gpt = *ptes = NULL;
+
if (pgpt) {
kfree(pgpt);
pgpt = NULL;
^ permalink raw reply [flat|nested] 39+ messages in thread
* [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (30 preceding siblings ...)
2002-02-14 17:11 ` Alex Williamson
@ 2002-02-14 17:11 ` Alex Williamson
2002-02-14 19:05 ` Matt_Domsch
` (5 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-14 17:11 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
I was testing w/ some disks that appear to have bad partition
tables and was getting the following error messages:
SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
Use GNU Parted to correct disk.
Unfortunately, that's not where the problem stopped. I got
random pointer dereference problems, and was apparently having
data structures freed out from under them. Turns out the
find_valid_gpt() was freeing data structures more than once and
passing back pointers to freed structures. Patch below.
Alex
--
Alex Williamson Linux Development Lab
alex_williamson@hp.com Hewlett Packard
970-898-9173 Fort Collins, CO
[-- Attachment #2: efi.diff --]
[-- Type: text/plain, Size: 692 bytes --]
--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2
+++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000
@@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc
*gpt = pgpt;
*ptes = pptes;
- if (agpt)
+ if (agpt) {
kfree(agpt);
- if (aptes)
+ agpt = NULL;
+ }
+ if (aptes) {
kfree(aptes);
+ aptes = NULL;
+ }
} /* if primary is valid */
else {
/* Primary GPT is bad, check the Alternate GPT */
@@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc
/* Both primary and alternate GPTs are bad, and/or PMBR is invalid.
* This isn't our disk, return 0.
*/
+ *gpt = *ptes = NULL;
+
if (pgpt) {
kfree(pgpt);
pgpt = NULL;
^ permalink raw reply [flat|nested] 39+ messages in thread
* [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (15 preceding siblings ...)
2002-02-14 17:11 ` Alex Williamson
@ 2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
` (20 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-14 17:11 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
I was testing w/ some disks that appear to have bad partition
tables and was getting the following error messages:
SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
Use GNU Parted to correct disk.
Unfortunately, that's not where the problem stopped. I got
random pointer dereference problems, and was apparently having
data structures freed out from under them. Turns out the
find_valid_gpt() was freeing data structures more than once and
passing back pointers to freed structures. Patch below.
Alex
--
Alex Williamson Linux Development Lab
alex_williamson@hp.com Hewlett Packard
970-898-9173 Fort Collins, CO
[-- Attachment #2: efi.diff --]
[-- Type: text/plain, Size: 692 bytes --]
--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2
+++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000
@@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc
*gpt = pgpt;
*ptes = pptes;
- if (agpt)
+ if (agpt) {
kfree(agpt);
- if (aptes)
+ agpt = NULL;
+ }
+ if (aptes) {
kfree(aptes);
+ aptes = NULL;
+ }
} /* if primary is valid */
else {
/* Primary GPT is bad, check the Alternate GPT */
@@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc
/* Both primary and alternate GPTs are bad, and/or PMBR is invalid.
* This isn't our disk, return 0.
*/
+ *gpt = *ptes = NULL;
+
if (pgpt) {
kfree(pgpt);
pgpt = NULL;
^ permalink raw reply [flat|nested] 39+ messages in thread
* [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (10 preceding siblings ...)
2002-02-14 17:11 ` Alex Williamson
@ 2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
` (25 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-14 17:11 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
I was testing w/ some disks that appear to have bad partition
tables and was getting the following error messages:
SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
Use GNU Parted to correct disk.
Unfortunately, that's not where the problem stopped. I got
random pointer dereference problems, and was apparently having
data structures freed out from under them. Turns out the
find_valid_gpt() was freeing data structures more than once and
passing back pointers to freed structures. Patch below.
Alex
--
Alex Williamson Linux Development Lab
alex_williamson@hp.com Hewlett Packard
970-898-9173 Fort Collins, CO
[-- Attachment #2: efi.diff --]
[-- Type: text/plain, Size: 692 bytes --]
--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2
+++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000
@@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc
*gpt = pgpt;
*ptes = pptes;
- if (agpt)
+ if (agpt) {
kfree(agpt);
- if (aptes)
+ agpt = NULL;
+ }
+ if (aptes) {
kfree(aptes);
+ aptes = NULL;
+ }
} /* if primary is valid */
else {
/* Primary GPT is bad, check the Alternate GPT */
@@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc
/* Both primary and alternate GPTs are bad, and/or PMBR is invalid.
* This isn't our disk, return 0.
*/
+ *gpt = *ptes = NULL;
+
if (pgpt) {
kfree(pgpt);
pgpt = NULL;
^ permalink raw reply [flat|nested] 39+ messages in thread
* [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (21 preceding siblings ...)
2002-02-14 17:11 ` Alex Williamson
@ 2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
` (14 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-14 17:11 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
I was testing w/ some disks that appear to have bad partition
tables and was getting the following error messages:
SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
Use GNU Parted to correct disk.
Unfortunately, that's not where the problem stopped. I got
random pointer dereference problems, and was apparently having
data structures freed out from under them. Turns out the
find_valid_gpt() was freeing data structures more than once and
passing back pointers to freed structures. Patch below.
Alex
--
Alex Williamson Linux Development Lab
alex_williamson@hp.com Hewlett Packard
970-898-9173 Fort Collins, CO
[-- Attachment #2: efi.diff --]
[-- Type: text/plain, Size: 692 bytes --]
--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2
+++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000
@@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc
*gpt = pgpt;
*ptes = pptes;
- if (agpt)
+ if (agpt) {
kfree(agpt);
- if (aptes)
+ agpt = NULL;
+ }
+ if (aptes) {
kfree(aptes);
+ aptes = NULL;
+ }
} /* if primary is valid */
else {
/* Primary GPT is bad, check the Alternate GPT */
@@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc
/* Both primary and alternate GPTs are bad, and/or PMBR is invalid.
* This isn't our disk, return 0.
*/
+ *gpt = *ptes = NULL;
+
if (pgpt) {
kfree(pgpt);
pgpt = NULL;
^ permalink raw reply [flat|nested] 39+ messages in thread
* [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (8 preceding siblings ...)
2002-02-14 17:11 ` Alex Williamson
@ 2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
` (27 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-14 17:11 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
I was testing w/ some disks that appear to have bad partition
tables and was getting the following error messages:
SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
Use GNU Parted to correct disk.
Unfortunately, that's not where the problem stopped. I got
random pointer dereference problems, and was apparently having
data structures freed out from under them. Turns out the
find_valid_gpt() was freeing data structures more than once and
passing back pointers to freed structures. Patch below.
Alex
--
Alex Williamson Linux Development Lab
alex_williamson@hp.com Hewlett Packard
970-898-9173 Fort Collins, CO
[-- Attachment #2: efi.diff --]
[-- Type: text/plain, Size: 692 bytes --]
--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2
+++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000
@@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc
*gpt = pgpt;
*ptes = pptes;
- if (agpt)
+ if (agpt) {
kfree(agpt);
- if (aptes)
+ agpt = NULL;
+ }
+ if (aptes) {
kfree(aptes);
+ aptes = NULL;
+ }
} /* if primary is valid */
else {
/* Primary GPT is bad, check the Alternate GPT */
@@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc
/* Both primary and alternate GPTs are bad, and/or PMBR is invalid.
* This isn't our disk, return 0.
*/
+ *gpt = *ptes = NULL;
+
if (pgpt) {
kfree(pgpt);
pgpt = NULL;
^ permalink raw reply [flat|nested] 39+ messages in thread
* [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (9 preceding siblings ...)
2002-02-14 17:11 ` Alex Williamson
@ 2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
` (26 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-14 17:11 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
I was testing w/ some disks that appear to have bad partition
tables and was getting the following error messages:
SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
Use GNU Parted to correct disk.
Unfortunately, that's not where the problem stopped. I got
random pointer dereference problems, and was apparently having
data structures freed out from under them. Turns out the
find_valid_gpt() was freeing data structures more than once and
passing back pointers to freed structures. Patch below.
Alex
--
Alex Williamson Linux Development Lab
alex_williamson@hp.com Hewlett Packard
970-898-9173 Fort Collins, CO
[-- Attachment #2: efi.diff --]
[-- Type: text/plain, Size: 692 bytes --]
--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2
+++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000
@@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc
*gpt = pgpt;
*ptes = pptes;
- if (agpt)
+ if (agpt) {
kfree(agpt);
- if (aptes)
+ agpt = NULL;
+ }
+ if (aptes) {
kfree(aptes);
+ aptes = NULL;
+ }
} /* if primary is valid */
else {
/* Primary GPT is bad, check the Alternate GPT */
@@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc
/* Both primary and alternate GPTs are bad, and/or PMBR is invalid.
* This isn't our disk, return 0.
*/
+ *gpt = *ptes = NULL;
+
if (pgpt) {
kfree(pgpt);
pgpt = NULL;
^ permalink raw reply [flat|nested] 39+ messages in thread
* [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (19 preceding siblings ...)
2002-02-14 17:11 ` Alex Williamson
@ 2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
` (16 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-14 17:11 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
I was testing w/ some disks that appear to have bad partition
tables and was getting the following error messages:
SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
Use GNU Parted to correct disk.
Unfortunately, that's not where the problem stopped. I got
random pointer dereference problems, and was apparently having
data structures freed out from under them. Turns out the
find_valid_gpt() was freeing data structures more than once and
passing back pointers to freed structures. Patch below.
Alex
--
Alex Williamson Linux Development Lab
alex_williamson@hp.com Hewlett Packard
970-898-9173 Fort Collins, CO
[-- Attachment #2: efi.diff --]
[-- Type: text/plain, Size: 692 bytes --]
--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2
+++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000
@@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc
*gpt = pgpt;
*ptes = pptes;
- if (agpt)
+ if (agpt) {
kfree(agpt);
- if (aptes)
+ agpt = NULL;
+ }
+ if (aptes) {
kfree(aptes);
+ aptes = NULL;
+ }
} /* if primary is valid */
else {
/* Primary GPT is bad, check the Alternate GPT */
@@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc
/* Both primary and alternate GPTs are bad, and/or PMBR is invalid.
* This isn't our disk, return 0.
*/
+ *gpt = *ptes = NULL;
+
if (pgpt) {
kfree(pgpt);
pgpt = NULL;
^ permalink raw reply [flat|nested] 39+ messages in thread
* [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
2002-02-14 17:11 ` Alex Williamson
@ 2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
` (35 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-14 17:11 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
I was testing w/ some disks that appear to have bad partition
tables and was getting the following error messages:
SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
Use GNU Parted to correct disk.
Unfortunately, that's not where the problem stopped. I got
random pointer dereference problems, and was apparently having
data structures freed out from under them. Turns out the
find_valid_gpt() was freeing data structures more than once and
passing back pointers to freed structures. Patch below.
Alex
--
Alex Williamson Linux Development Lab
alex_williamson@hp.com Hewlett Packard
970-898-9173 Fort Collins, CO
[-- Attachment #2: efi.diff --]
[-- Type: text/plain, Size: 692 bytes --]
--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2
+++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000
@@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc
*gpt = pgpt;
*ptes = pptes;
- if (agpt)
+ if (agpt) {
kfree(agpt);
- if (aptes)
+ agpt = NULL;
+ }
+ if (aptes) {
kfree(aptes);
+ aptes = NULL;
+ }
} /* if primary is valid */
else {
/* Primary GPT is bad, check the Alternate GPT */
@@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc
/* Both primary and alternate GPTs are bad, and/or PMBR is invalid.
* This isn't our disk, return 0.
*/
+ *gpt = *ptes = NULL;
+
if (pgpt) {
kfree(pgpt);
pgpt = NULL;
^ permalink raw reply [flat|nested] 39+ messages in thread
* [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (27 preceding siblings ...)
2002-02-14 17:11 ` Alex Williamson
@ 2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
` (8 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-14 17:11 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
I was testing w/ some disks that appear to have bad partition
tables and was getting the following error messages:
SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
Use GNU Parted to correct disk.
Unfortunately, that's not where the problem stopped. I got
random pointer dereference problems, and was apparently having
data structures freed out from under them. Turns out the
find_valid_gpt() was freeing data structures more than once and
passing back pointers to freed structures. Patch below.
Alex
--
Alex Williamson Linux Development Lab
alex_williamson@hp.com Hewlett Packard
970-898-9173 Fort Collins, CO
[-- Attachment #2: efi.diff --]
[-- Type: text/plain, Size: 692 bytes --]
--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2
+++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000
@@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc
*gpt = pgpt;
*ptes = pptes;
- if (agpt)
+ if (agpt) {
kfree(agpt);
- if (aptes)
+ agpt = NULL;
+ }
+ if (aptes) {
kfree(aptes);
+ aptes = NULL;
+ }
} /* if primary is valid */
else {
/* Primary GPT is bad, check the Alternate GPT */
@@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc
/* Both primary and alternate GPTs are bad, and/or PMBR is invalid.
* This isn't our disk, return 0.
*/
+ *gpt = *ptes = NULL;
+
if (pgpt) {
kfree(pgpt);
pgpt = NULL;
^ permalink raw reply [flat|nested] 39+ messages in thread
* [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (20 preceding siblings ...)
2002-02-14 17:11 ` Alex Williamson
@ 2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
` (15 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-14 17:11 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
I was testing w/ some disks that appear to have bad partition
tables and was getting the following error messages:
SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
Use GNU Parted to correct disk.
Unfortunately, that's not where the problem stopped. I got
random pointer dereference problems, and was apparently having
data structures freed out from under them. Turns out the
find_valid_gpt() was freeing data structures more than once and
passing back pointers to freed structures. Patch below.
Alex
--
Alex Williamson Linux Development Lab
alex_williamson@hp.com Hewlett Packard
970-898-9173 Fort Collins, CO
[-- Attachment #2: efi.diff --]
[-- Type: text/plain, Size: 692 bytes --]
--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2
+++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000
@@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc
*gpt = pgpt;
*ptes = pptes;
- if (agpt)
+ if (agpt) {
kfree(agpt);
- if (aptes)
+ agpt = NULL;
+ }
+ if (aptes) {
kfree(aptes);
+ aptes = NULL;
+ }
} /* if primary is valid */
else {
/* Primary GPT is bad, check the Alternate GPT */
@@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc
/* Both primary and alternate GPTs are bad, and/or PMBR is invalid.
* This isn't our disk, return 0.
*/
+ *gpt = *ptes = NULL;
+
if (pgpt) {
kfree(pgpt);
pgpt = NULL;
^ permalink raw reply [flat|nested] 39+ messages in thread
* [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (17 preceding siblings ...)
2002-02-14 17:11 ` Alex Williamson
@ 2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
` (18 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-14 17:11 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
I was testing w/ some disks that appear to have bad partition
tables and was getting the following error messages:
SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
Use GNU Parted to correct disk.
Unfortunately, that's not where the problem stopped. I got
random pointer dereference problems, and was apparently having
data structures freed out from under them. Turns out the
find_valid_gpt() was freeing data structures more than once and
passing back pointers to freed structures. Patch below.
Alex
--
Alex Williamson Linux Development Lab
alex_williamson@hp.com Hewlett Packard
970-898-9173 Fort Collins, CO
[-- Attachment #2: efi.diff --]
[-- Type: text/plain, Size: 692 bytes --]
--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2
+++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000
@@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc
*gpt = pgpt;
*ptes = pptes;
- if (agpt)
+ if (agpt) {
kfree(agpt);
- if (aptes)
+ agpt = NULL;
+ }
+ if (aptes) {
kfree(aptes);
+ aptes = NULL;
+ }
} /* if primary is valid */
else {
/* Primary GPT is bad, check the Alternate GPT */
@@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc
/* Both primary and alternate GPTs are bad, and/or PMBR is invalid.
* This isn't our disk, return 0.
*/
+ *gpt = *ptes = NULL;
+
if (pgpt) {
kfree(pgpt);
pgpt = NULL;
^ permalink raw reply [flat|nested] 39+ messages in thread
* [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (6 preceding siblings ...)
2002-02-14 17:11 ` Alex Williamson
@ 2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
` (29 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-14 17:11 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
I was testing w/ some disks that appear to have bad partition
tables and was getting the following error messages:
SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
Use GNU Parted to correct disk.
Unfortunately, that's not where the problem stopped. I got
random pointer dereference problems, and was apparently having
data structures freed out from under them. Turns out the
find_valid_gpt() was freeing data structures more than once and
passing back pointers to freed structures. Patch below.
Alex
--
Alex Williamson Linux Development Lab
alex_williamson@hp.com Hewlett Packard
970-898-9173 Fort Collins, CO
[-- Attachment #2: efi.diff --]
[-- Type: text/plain, Size: 692 bytes --]
--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2
+++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000
@@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc
*gpt = pgpt;
*ptes = pptes;
- if (agpt)
+ if (agpt) {
kfree(agpt);
- if (aptes)
+ agpt = NULL;
+ }
+ if (aptes) {
kfree(aptes);
+ aptes = NULL;
+ }
} /* if primary is valid */
else {
/* Primary GPT is bad, check the Alternate GPT */
@@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc
/* Both primary and alternate GPTs are bad, and/or PMBR is invalid.
* This isn't our disk, return 0.
*/
+ *gpt = *ptes = NULL;
+
if (pgpt) {
kfree(pgpt);
pgpt = NULL;
^ permalink raw reply [flat|nested] 39+ messages in thread
* [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (3 preceding siblings ...)
2002-02-14 17:11 ` Alex Williamson
@ 2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
` (32 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-14 17:11 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
I was testing w/ some disks that appear to have bad partition
tables and was getting the following error messages:
SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
Use GNU Parted to correct disk.
Unfortunately, that's not where the problem stopped. I got
random pointer dereference problems, and was apparently having
data structures freed out from under them. Turns out the
find_valid_gpt() was freeing data structures more than once and
passing back pointers to freed structures. Patch below.
Alex
--
Alex Williamson Linux Development Lab
alex_williamson@hp.com Hewlett Packard
970-898-9173 Fort Collins, CO
[-- Attachment #2: efi.diff --]
[-- Type: text/plain, Size: 692 bytes --]
--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2
+++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000
@@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc
*gpt = pgpt;
*ptes = pptes;
- if (agpt)
+ if (agpt) {
kfree(agpt);
- if (aptes)
+ agpt = NULL;
+ }
+ if (aptes) {
kfree(aptes);
+ aptes = NULL;
+ }
} /* if primary is valid */
else {
/* Primary GPT is bad, check the Alternate GPT */
@@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc
/* Both primary and alternate GPTs are bad, and/or PMBR is invalid.
* This isn't our disk, return 0.
*/
+ *gpt = *ptes = NULL;
+
if (pgpt) {
kfree(pgpt);
pgpt = NULL;
^ permalink raw reply [flat|nested] 39+ messages in thread
* [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (25 preceding siblings ...)
2002-02-14 17:11 ` Alex Williamson
@ 2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
` (10 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-14 17:11 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
I was testing w/ some disks that appear to have bad partition
tables and was getting the following error messages:
SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
Use GNU Parted to correct disk.
Unfortunately, that's not where the problem stopped. I got
random pointer dereference problems, and was apparently having
data structures freed out from under them. Turns out the
find_valid_gpt() was freeing data structures more than once and
passing back pointers to freed structures. Patch below.
Alex
--
Alex Williamson Linux Development Lab
alex_williamson@hp.com Hewlett Packard
970-898-9173 Fort Collins, CO
[-- Attachment #2: efi.diff --]
[-- Type: text/plain, Size: 692 bytes --]
--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2
+++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000
@@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc
*gpt = pgpt;
*ptes = pptes;
- if (agpt)
+ if (agpt) {
kfree(agpt);
- if (aptes)
+ agpt = NULL;
+ }
+ if (aptes) {
kfree(aptes);
+ aptes = NULL;
+ }
} /* if primary is valid */
else {
/* Primary GPT is bad, check the Alternate GPT */
@@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc
/* Both primary and alternate GPTs are bad, and/or PMBR is invalid.
* This isn't our disk, return 0.
*/
+ *gpt = *ptes = NULL;
+
if (pgpt) {
kfree(pgpt);
pgpt = NULL;
^ permalink raw reply [flat|nested] 39+ messages in thread
* [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (26 preceding siblings ...)
2002-02-14 17:11 ` Alex Williamson
@ 2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
` (9 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-14 17:11 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
I was testing w/ some disks that appear to have bad partition
tables and was getting the following error messages:
SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
Use GNU Parted to correct disk.
Unfortunately, that's not where the problem stopped. I got
random pointer dereference problems, and was apparently having
data structures freed out from under them. Turns out the
find_valid_gpt() was freeing data structures more than once and
passing back pointers to freed structures. Patch below.
Alex
--
Alex Williamson Linux Development Lab
alex_williamson@hp.com Hewlett Packard
970-898-9173 Fort Collins, CO
[-- Attachment #2: efi.diff --]
[-- Type: text/plain, Size: 692 bytes --]
--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2
+++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000
@@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc
*gpt = pgpt;
*ptes = pptes;
- if (agpt)
+ if (agpt) {
kfree(agpt);
- if (aptes)
+ agpt = NULL;
+ }
+ if (aptes) {
kfree(aptes);
+ aptes = NULL;
+ }
} /* if primary is valid */
else {
/* Primary GPT is bad, check the Alternate GPT */
@@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc
/* Both primary and alternate GPTs are bad, and/or PMBR is invalid.
* This isn't our disk, return 0.
*/
+ *gpt = *ptes = NULL;
+
if (pgpt) {
kfree(pgpt);
pgpt = NULL;
^ permalink raw reply [flat|nested] 39+ messages in thread
* [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (13 preceding siblings ...)
2002-02-14 17:11 ` Alex Williamson
@ 2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
` (22 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-14 17:11 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
I was testing w/ some disks that appear to have bad partition
tables and was getting the following error messages:
SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
Use GNU Parted to correct disk.
Unfortunately, that's not where the problem stopped. I got
random pointer dereference problems, and was apparently having
data structures freed out from under them. Turns out the
find_valid_gpt() was freeing data structures more than once and
passing back pointers to freed structures. Patch below.
Alex
--
Alex Williamson Linux Development Lab
alex_williamson@hp.com Hewlett Packard
970-898-9173 Fort Collins, CO
[-- Attachment #2: efi.diff --]
[-- Type: text/plain, Size: 692 bytes --]
--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2
+++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000
@@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc
*gpt = pgpt;
*ptes = pptes;
- if (agpt)
+ if (agpt) {
kfree(agpt);
- if (aptes)
+ agpt = NULL;
+ }
+ if (aptes) {
kfree(aptes);
+ aptes = NULL;
+ }
} /* if primary is valid */
else {
/* Primary GPT is bad, check the Alternate GPT */
@@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc
/* Both primary and alternate GPTs are bad, and/or PMBR is invalid.
* This isn't our disk, return 0.
*/
+ *gpt = *ptes = NULL;
+
if (pgpt) {
kfree(pgpt);
pgpt = NULL;
^ permalink raw reply [flat|nested] 39+ messages in thread
* [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (12 preceding siblings ...)
2002-02-14 17:11 ` Alex Williamson
@ 2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
` (23 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-14 17:11 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
I was testing w/ some disks that appear to have bad partition
tables and was getting the following error messages:
SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
Use GNU Parted to correct disk.
Unfortunately, that's not where the problem stopped. I got
random pointer dereference problems, and was apparently having
data structures freed out from under them. Turns out the
find_valid_gpt() was freeing data structures more than once and
passing back pointers to freed structures. Patch below.
Alex
--
Alex Williamson Linux Development Lab
alex_williamson@hp.com Hewlett Packard
970-898-9173 Fort Collins, CO
[-- Attachment #2: efi.diff --]
[-- Type: text/plain, Size: 692 bytes --]
--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2
+++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000
@@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc
*gpt = pgpt;
*ptes = pptes;
- if (agpt)
+ if (agpt) {
kfree(agpt);
- if (aptes)
+ agpt = NULL;
+ }
+ if (aptes) {
kfree(aptes);
+ aptes = NULL;
+ }
} /* if primary is valid */
else {
/* Primary GPT is bad, check the Alternate GPT */
@@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc
/* Both primary and alternate GPTs are bad, and/or PMBR is invalid.
* This isn't our disk, return 0.
*/
+ *gpt = *ptes = NULL;
+
if (pgpt) {
kfree(pgpt);
pgpt = NULL;
^ permalink raw reply [flat|nested] 39+ messages in thread
* [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (4 preceding siblings ...)
2002-02-14 17:11 ` Alex Williamson
@ 2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
` (31 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-14 17:11 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
I was testing w/ some disks that appear to have bad partition
tables and was getting the following error messages:
SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
Use GNU Parted to correct disk.
Unfortunately, that's not where the problem stopped. I got
random pointer dereference problems, and was apparently having
data structures freed out from under them. Turns out the
find_valid_gpt() was freeing data structures more than once and
passing back pointers to freed structures. Patch below.
Alex
--
Alex Williamson Linux Development Lab
alex_williamson@hp.com Hewlett Packard
970-898-9173 Fort Collins, CO
[-- Attachment #2: efi.diff --]
[-- Type: text/plain, Size: 692 bytes --]
--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2
+++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000
@@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc
*gpt = pgpt;
*ptes = pptes;
- if (agpt)
+ if (agpt) {
kfree(agpt);
- if (aptes)
+ agpt = NULL;
+ }
+ if (aptes) {
kfree(aptes);
+ aptes = NULL;
+ }
} /* if primary is valid */
else {
/* Primary GPT is bad, check the Alternate GPT */
@@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc
/* Both primary and alternate GPTs are bad, and/or PMBR is invalid.
* This isn't our disk, return 0.
*/
+ *gpt = *ptes = NULL;
+
if (pgpt) {
kfree(pgpt);
pgpt = NULL;
^ permalink raw reply [flat|nested] 39+ messages in thread
* [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (22 preceding siblings ...)
2002-02-14 17:11 ` Alex Williamson
@ 2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
` (13 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-14 17:11 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
I was testing w/ some disks that appear to have bad partition
tables and was getting the following error messages:
SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
Use GNU Parted to correct disk.
Unfortunately, that's not where the problem stopped. I got
random pointer dereference problems, and was apparently having
data structures freed out from under them. Turns out the
find_valid_gpt() was freeing data structures more than once and
passing back pointers to freed structures. Patch below.
Alex
--
Alex Williamson Linux Development Lab
alex_williamson@hp.com Hewlett Packard
970-898-9173 Fort Collins, CO
[-- Attachment #2: efi.diff --]
[-- Type: text/plain, Size: 692 bytes --]
--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2
+++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000
@@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc
*gpt = pgpt;
*ptes = pptes;
- if (agpt)
+ if (agpt) {
kfree(agpt);
- if (aptes)
+ agpt = NULL;
+ }
+ if (aptes) {
kfree(aptes);
+ aptes = NULL;
+ }
} /* if primary is valid */
else {
/* Primary GPT is bad, check the Alternate GPT */
@@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc
/* Both primary and alternate GPTs are bad, and/or PMBR is invalid.
* This isn't our disk, return 0.
*/
+ *gpt = *ptes = NULL;
+
if (pgpt) {
kfree(pgpt);
pgpt = NULL;
^ permalink raw reply [flat|nested] 39+ messages in thread
* [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (28 preceding siblings ...)
2002-02-14 17:11 ` Alex Williamson
@ 2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
` (7 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-14 17:11 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
I was testing w/ some disks that appear to have bad partition
tables and was getting the following error messages:
SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
Use GNU Parted to correct disk.
Unfortunately, that's not where the problem stopped. I got
random pointer dereference problems, and was apparently having
data structures freed out from under them. Turns out the
find_valid_gpt() was freeing data structures more than once and
passing back pointers to freed structures. Patch below.
Alex
--
Alex Williamson Linux Development Lab
alex_williamson@hp.com Hewlett Packard
970-898-9173 Fort Collins, CO
[-- Attachment #2: efi.diff --]
[-- Type: text/plain, Size: 692 bytes --]
--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2
+++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000
@@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc
*gpt = pgpt;
*ptes = pptes;
- if (agpt)
+ if (agpt) {
kfree(agpt);
- if (aptes)
+ agpt = NULL;
+ }
+ if (aptes) {
kfree(aptes);
+ aptes = NULL;
+ }
} /* if primary is valid */
else {
/* Primary GPT is bad, check the Alternate GPT */
@@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc
/* Both primary and alternate GPTs are bad, and/or PMBR is invalid.
* This isn't our disk, return 0.
*/
+ *gpt = *ptes = NULL;
+
if (pgpt) {
kfree(pgpt);
pgpt = NULL;
^ permalink raw reply [flat|nested] 39+ messages in thread
* [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (23 preceding siblings ...)
2002-02-14 17:11 ` Alex Williamson
@ 2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
` (12 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-14 17:11 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
I was testing w/ some disks that appear to have bad partition
tables and was getting the following error messages:
SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
Use GNU Parted to correct disk.
Unfortunately, that's not where the problem stopped. I got
random pointer dereference problems, and was apparently having
data structures freed out from under them. Turns out the
find_valid_gpt() was freeing data structures more than once and
passing back pointers to freed structures. Patch below.
Alex
--
Alex Williamson Linux Development Lab
alex_williamson@hp.com Hewlett Packard
970-898-9173 Fort Collins, CO
[-- Attachment #2: efi.diff --]
[-- Type: text/plain, Size: 692 bytes --]
--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2
+++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000
@@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc
*gpt = pgpt;
*ptes = pptes;
- if (agpt)
+ if (agpt) {
kfree(agpt);
- if (aptes)
+ agpt = NULL;
+ }
+ if (aptes) {
kfree(aptes);
+ aptes = NULL;
+ }
} /* if primary is valid */
else {
/* Primary GPT is bad, check the Alternate GPT */
@@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc
/* Both primary and alternate GPTs are bad, and/or PMBR is invalid.
* This isn't our disk, return 0.
*/
+ *gpt = *ptes = NULL;
+
if (pgpt) {
kfree(pgpt);
pgpt = NULL;
^ permalink raw reply [flat|nested] 39+ messages in thread
* [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (2 preceding siblings ...)
2002-02-14 17:11 ` Alex Williamson
@ 2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
` (33 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-14 17:11 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
I was testing w/ some disks that appear to have bad partition
tables and was getting the following error messages:
SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
Use GNU Parted to correct disk.
Unfortunately, that's not where the problem stopped. I got
random pointer dereference problems, and was apparently having
data structures freed out from under them. Turns out the
find_valid_gpt() was freeing data structures more than once and
passing back pointers to freed structures. Patch below.
Alex
--
Alex Williamson Linux Development Lab
alex_williamson@hp.com Hewlett Packard
970-898-9173 Fort Collins, CO
[-- Attachment #2: efi.diff --]
[-- Type: text/plain, Size: 692 bytes --]
--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2
+++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000
@@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc
*gpt = pgpt;
*ptes = pptes;
- if (agpt)
+ if (agpt) {
kfree(agpt);
- if (aptes)
+ agpt = NULL;
+ }
+ if (aptes) {
kfree(aptes);
+ aptes = NULL;
+ }
} /* if primary is valid */
else {
/* Primary GPT is bad, check the Alternate GPT */
@@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc
/* Both primary and alternate GPTs are bad, and/or PMBR is invalid.
* This isn't our disk, return 0.
*/
+ *gpt = *ptes = NULL;
+
if (pgpt) {
kfree(pgpt);
pgpt = NULL;
^ permalink raw reply [flat|nested] 39+ messages in thread
* [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (24 preceding siblings ...)
2002-02-14 17:11 ` Alex Williamson
@ 2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
` (11 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-14 17:11 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
I was testing w/ some disks that appear to have bad partition
tables and was getting the following error messages:
SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
Use GNU Parted to correct disk.
Unfortunately, that's not where the problem stopped. I got
random pointer dereference problems, and was apparently having
data structures freed out from under them. Turns out the
find_valid_gpt() was freeing data structures more than once and
passing back pointers to freed structures. Patch below.
Alex
--
Alex Williamson Linux Development Lab
alex_williamson@hp.com Hewlett Packard
970-898-9173 Fort Collins, CO
[-- Attachment #2: efi.diff --]
[-- Type: text/plain, Size: 692 bytes --]
--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2
+++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000
@@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc
*gpt = pgpt;
*ptes = pptes;
- if (agpt)
+ if (agpt) {
kfree(agpt);
- if (aptes)
+ agpt = NULL;
+ }
+ if (aptes) {
kfree(aptes);
+ aptes = NULL;
+ }
} /* if primary is valid */
else {
/* Primary GPT is bad, check the Alternate GPT */
@@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc
/* Both primary and alternate GPTs are bad, and/or PMBR is invalid.
* This isn't our disk, return 0.
*/
+ *gpt = *ptes = NULL;
+
if (pgpt) {
kfree(pgpt);
pgpt = NULL;
^ permalink raw reply [flat|nested] 39+ messages in thread
* RE: [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (31 preceding siblings ...)
2002-02-14 17:11 ` Alex Williamson
@ 2002-02-14 19:05 ` Matt_Domsch
2002-02-15 14:30 ` William Lee Irwin III
` (4 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Matt_Domsch @ 2002-02-14 19:05 UTC (permalink / raw)
To: linux-ia64
> I got random pointer dereference problems, and was apparently having
> data structures freed out from under them. Turns out the
> find_valid_gpt() was freeing data structures more than once and
> passing back pointers to freed structures. Patch below.
Mia culpa. Pass the brown paper bag. Thanks for the fix.
-Matt
--
Matt Domsch
Sr. Software Engineer
Dell Linux Solutions www.dell.com/linux
#1 US Linux Server provider with 24.5% (IDC Dec 2001)
#2 Worldwide Linux Server provider with 18.2% (IDC Dec 2001)
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (32 preceding siblings ...)
2002-02-14 19:05 ` Matt_Domsch
@ 2002-02-15 14:30 ` William Lee Irwin III
2002-02-15 15:09 ` Alex Williamson
` (3 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: William Lee Irwin III @ 2002-02-15 14:30 UTC (permalink / raw)
To: linux-ia64
On Thu, Feb 14, 2002 at 10:11:19AM -0700, Alex Williamson wrote:
> I was testing w/ some disks that appear to have bad partition
> tables and was getting the following error messages:
> SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
> sdt:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
> Use GNU Parted to correct disk.
> Unfortunately, that's not where the problem stopped. I got
> random pointer dereference problems, and was apparently having
> data structures freed out from under them. Turns out the
> find_valid_gpt() was freeing data structures more than once and
> passing back pointers to freed structures. Patch below.
Is it just me or is this getting resent every couple of hours?
... something has gone horribly wrong.
Cheers,
Bill
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (33 preceding siblings ...)
2002-02-15 14:30 ` William Lee Irwin III
@ 2002-02-15 15:09 ` Alex Williamson
2002-02-15 20:00 ` David Mosberger
` (2 subsequent siblings)
37 siblings, 0 replies; 39+ messages in thread
From: Alex Williamson @ 2002-02-15 15:09 UTC (permalink / raw)
To: linux-ia64
On Fri, 2002-02-15 at 07:30, William Lee Irwin III wrote:
>
> Is it just me or is this getting resent every couple of hours?
> ... something has gone horribly wrong.
>
Yes it has, and I apologize. I wish it was a machine close enough
that I could just yank the LAN tap, but unfortunately it's on the
other side of the HP network. Seems that a combination of a poorly
configured HP server and a slow sourceforge mail server are having
just enough trouble talking that the mail gets through but the
acknowledgement gets dropped. What was that about pass the brown
paper bag? Sorry folks, I'll try to get the message killed ASAP.
Thanks,
Alex
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (34 preceding siblings ...)
2002-02-15 15:09 ` Alex Williamson
@ 2002-02-15 20:00 ` David Mosberger
2002-02-16 0:46 ` John Hesterberg
2002-02-16 0:52 ` David Mosberger
37 siblings, 0 replies; 39+ messages in thread
From: David Mosberger @ 2002-02-15 20:00 UTC (permalink / raw)
To: linux-ia64
>>>>> On Thu, 14 Feb 2002 10:11:19 -0700, Alex Williamson <alex_williamson@hp.com> said:
Alex> I was testing w/ some disks that appear to have bad
Alex> partition tables and was getting the following error messages:
Alex> SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
Alex> sdt:<4> Warning: Disk has a valid GPT signature but invalid
Alex> PMBR. Use GNU Parted to correct disk.
Alex> Unfortunately, that's not where the problem stopped. I got
Alex> random pointer dereference problems, and was apparently having
Alex> data structures freed out from under them. Turns out the
Alex> find_valid_gpt() was freeing data structures more than once
Alex> and passing back pointers to freed structures. Patch below.
Applied, thanks!
--david
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (35 preceding siblings ...)
2002-02-15 20:00 ` David Mosberger
@ 2002-02-16 0:46 ` John Hesterberg
2002-02-16 0:52 ` David Mosberger
37 siblings, 0 replies; 39+ messages in thread
From: John Hesterberg @ 2002-02-16 0:46 UTC (permalink / raw)
To: linux-ia64
On Fri, Feb 15, 2002 at 12:00:31PM -0800, David Mosberger wrote:
> >>>>> On Thu, 14 Feb 2002 10:11:19 -0700, Alex Williamson <alex_williamson@hp.com> said:
>
> Alex> I was testing w/ some disks that appear to have bad
> Alex> partition tables and was getting the following error messages:
>
> Alex> SCSI device sdt: 35566480 512-byte hdwr sectors (18210 MB)
> Alex> sdt:<4> Warning: Disk has a valid GPT signature but invalid
> Alex> PMBR. Use GNU Parted to correct disk.
>
> Alex> Unfortunately, that's not where the problem stopped. I got
> Alex> random pointer dereference problems, and was apparently having
> Alex> data structures freed out from under them. Turns out the
> Alex> find_valid_gpt() was freeing data structures more than once
> Alex> and passing back pointers to freed structures. Patch below.
>
> Applied, thanks!
>
> --david
So the key to getting things applied to keep sending the exact same
message over and over and over?
:-)
John
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
` (36 preceding siblings ...)
2002-02-16 0:46 ` John Hesterberg
@ 2002-02-16 0:52 ` David Mosberger
37 siblings, 0 replies; 39+ messages in thread
From: David Mosberger @ 2002-02-16 0:52 UTC (permalink / raw)
To: linux-ia64
>>>>> On Fri, 15 Feb 2002 18:46:14 -0600, John Hesterberg <jh@sgi.com> said:
John> So the key to getting things applied to keep sending the exact
John> same message over and over and over?
John> :-)
Actually, I saw Alex's mail only once. If you use procmail, I highly
recommend adding the following rule near the top of your .procmailrc:
# suppress duplicate mails (e.g., mail sent to multiple mailing lists)
:0 Wh: msgid.lock
| formail -D 32768 mail/msgid.cache
This keeps off all those annoying replicants when cc'd both explicitly
and on mailing-lists.
--david
^ permalink raw reply [flat|nested] 39+ messages in thread
end of thread, other threads:[~2002-02-16 0:52 UTC | newest]
Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-14 17:11 [Linux-ia64] [PATCH] linux/fs/partitions/efi.c error handling Alex Williamson
2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
2002-02-14 17:11 ` Alex Williamson
2002-02-14 19:05 ` Matt_Domsch
2002-02-15 14:30 ` William Lee Irwin III
2002-02-15 15:09 ` Alex Williamson
2002-02-15 20:00 ` David Mosberger
2002-02-16 0:46 ` John Hesterberg
2002-02-16 0:52 ` David Mosberger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox