RE: dmraid -r -E bus error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2007-10-22 at 09:11 -0700, Hall, Eric R wrote:
> Out of curiosity, how is this patch different than the one that Jason
> Gaston and Ying Fang released on 29 June 2007 other than it seems to be
> more compact? ;)

It changes a completely different function, the write of the meta data
not the read.

> 
> http://www.redhat.com/archives/ataraid-list/2007-June/msg00037.html

I've had a look at the patch and I admit that the source I'm working
from doesn't contain this change and since I wasn't subscribed to the
list at that time I don't know the history.

It's not obvious, from that message (or messages in the thread index),
what the patch actually does to prevent a SEGV and I don't see how this
deals with the issue I'm trying to resolve, the SEGV when writing the
meta data.

Can someone explain the intent of the patch in the message above please?

> 
> - E
> 
> >-----Original Message-----
> >From: ataraid-list-bounces@xxxxxxxxxx [mailto:ataraid-list-
> >bounces@xxxxxxxxxx] On Behalf Of Ian Kent
> >Sent: Monday, October 22, 2007 12:16 AM
> >To: ataraid-list@xxxxxxxxxx
> >Subject: dmraid -r -E bus error
> >
> >
> >Hi all,
> >
> >The command "dmraid -r -E <raid dev>" SEGVs if there is a single device
> >in in the on disk meta data configuration.
> >
> >If the on disk meta data configuration contains one raid device only
> >(one block only) then the isw module determines there are no extended
> >attributes and extra space isn't allocated during the meta data read.
> >
> >However, the meta data write function fails to check whether the extra
> >space is present before copying the meta data and SEGVs when trying to
> >write it to the non existent memory.
> >
> >I consulted with Heinz Mauelshagen and we ended up with this patch.
> >Comments welcome.
> >
> >Ian
> >
> >---
> >diff -up 1.0.0.rc14/lib/format/ataraid/isw.c.solitary-meta-block
> >1.0.0.rc14/lib/format/ataraid/isw.c
> >--- 1.0.0.rc14/lib/format/ataraid/isw.c.solitary-meta-block
> 2006-09-23
> >02:11:37.000000000 +0800
> >+++ 1.0.0.rc14/lib/format/ataraid/isw.c	2007-10-22
> 15:10:49.000000000
> >+0800
> >@@ -364,21 +364,26 @@ static int isw_write(struct lib_context
> > {
> > 	int ret;
> > 	struct isw *isw = META(rd, isw);
> >+	int large = div_up(isw->mpb_size, ISW_DISK_BLOCK_SIZE) > 1;
> >
> > 	to_disk(isw, FULL);
> >
> >-	/*
> >-	 * Copy 1st metadata sector to after the extended ones
> >-	 * and increment metadata area pointer by one block, so
> >-	 * that the metadata is filed in the proper sequence.
> >-	 */
> >-	memcpy((void*) isw + rd->meta_areas->size, isw,
> ISW_DISK_BLOCK_SIZE);
> >-	rd->meta_areas->area += ISW_DISK_BLOCK_SIZE;
> >+	if (large) {
> >+		/*
> >+		 * Copy 1st metadata sector to after the extended ones
> >+		 * and increment metadata area pointer by one block, so
> >+		 * that the metadata is filed in the proper sequence.
> >+		 */
> >+		memcpy((void*) isw + rd->meta_areas->size, isw,
> >+		       ISW_DISK_BLOCK_SIZE);
> >+		rd->meta_areas->area += ISW_DISK_BLOCK_SIZE;
> >+	}
> >
> > 	ret = write_metadata(lc, handler, rd, -1, erase);
> >
> > 	/* Correct metadata area pointer. */
> >-	rd->meta_areas->area -= ISW_DISK_BLOCK_SIZE;
> >+	if (large)
> >+		rd->meta_areas->area -= ISW_DISK_BLOCK_SIZE;
> >
> > 	to_cpu(isw, FULL);
> >
> >
> >
> >_______________________________________________
> >Ataraid-list mailing list
> >Ataraid-list@xxxxxxxxxx
> >https://www.redhat.com/mailman/listinfo/ataraid-list
> 
> _______________________________________________
> Ataraid-list mailing list
> Ataraid-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/ataraid-list

_______________________________________________
Ataraid-list mailing list
Ataraid-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/ataraid-list

[Index of Archives]     [Linux RAID]     [Linux Device Mapper]     [Linux IDE]     [Linux SCSI]     [Kernel]     [Linux Books]     [Linux Admin]     [GFS]     [RPM]     [Yosemite Campgrounds]     [AMD 64]

  Powered by Linux