AF:
NF:0
PS:10
SRH:1
SFN:
DSR:
MID:
CFG:
PT:0
S:andy.sharp@onstor.com
RQ:
SSV:mail.onstor.net
NSV:
SSH:
R:<rendell.fong@onstor.com>
MAID:1
X-Sylpheed-Privacy-System:
X-Sylpheed-Sign:0
SCF:#mh/Mailbox/sent
RMID:#imap/andys@onstor.net@exch1.onstor.net/INBOX	0	2779531E7C760D4491C96305019FEEB52AC74C916A@exch1.onstor.net
X-Sylpheed-End-Special-Headers: 1
Date: Thu, 19 Mar 2009 17:33:26 -0700
From: Andrew Sharp <andy.sharp@onstor.com>
To: Rendell Fong <rendell.fong@onstor.com>
Subject: Re: please review - change 32139
Message-ID: <20090319173326.3f3b88ee@ripper.onstor.net>
In-Reply-To: <2779531E7C760D4491C96305019FEEB52AC74C916A@exch1.onstor.net>
References: <20090319150811.7012c5b3@ripper.onstor.net>
	<2779531E7C760D4491C96305019FEEB52AC74C916A@exch1.onstor.net>
Organization: Onstor
X-Mailer: Sylpheed-Claws 2.6.0 (GTK+ 2.8.20; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

~/debs-src/libe2fs/e2fsprogs-1.39+1.40-WIP-2006.11.14+dfsg

On Thu, 19 Mar 2009 15:56:15 -0700 Rendell Fong
<rendell.fong@onstor.com> wrote:

> See comments inline.
> 
> 
> > -----Original Message-----
> > From: Andy Sharp
> > Sent: Thursday, March 19, 2009 3:08 PM
> > To: Rendell Fong
> > Subject: Re: please review - change 32139
> > 
> > On Thu, 19 Mar 2009 12:58:13 -0700 Rendell Fong
> > <rendell.fong@onstor.com> wrote:
> > 
> > > Change 32139 by rendellf@rendellf-test on 2009/03/19 12:56:15
> > > *pending*
> > >
> > >         TED26011: can't load kernel from second CF card (sdb1)
> > >
> > >         Fixed disk controller register memory window address
> > > mapping for second card (socket B) to allow successive file
> > > loading from either CF card.
> > >
> > >         Fixed device partition string check used for detecting
> > > when partition is already initialized.
> > >
> > >         Fixed cleanup of socket (memory window unmapping and
> > > socket power down) when a probe of CF card fails.
> > >
> > >         Changed eee memory mgmt routine definitions to make
> > > ext2fs_get_mem() and ext2fs_free_mem() work as intended.
> > >
> > > Affected files ...
> > >
> > > ... //depot/dev/prom/cg/code/sm-pmonext2fs/alloc.c#1 edit
> > > ... //depot/dev/prom/cg/code/sm-pmonext2fs/badblocks.c#2 edit
> > > ... //depot/dev/prom/cg/code/sm-pmonext2fs/bitmaps.c#1 edit
> > > ... //depot/dev/prom/cg/code/sm-pmonext2fs/block.c#1 edit
> > > ... //depot/dev/prom/cg/code/sm-pmonext2fs/bmap.c#1 edit
> > > ... //depot/dev/prom/cg/code/sm-pmonext2fs/closefs.c#3 edit
> > > ... //depot/dev/prom/cg/code/sm-pmonext2fs/dir_iterate.c#1 edit
> > > ... //depot/dev/prom/cg/code/sm-pmonext2fs/dosio.c#3 edit
> > > ... //depot/dev/prom/cg/code/sm-pmonext2fs/dosio.h#1 edit
> > > ... //depot/dev/prom/cg/code/sm-pmonext2fs/ext2fs.c#4 edit
> > > ... //depot/dev/prom/cg/code/sm-pmonext2fs/ext2fs.h#2 edit
> > > ... //depot/dev/prom/cg/code/sm-pmonext2fs/fileio.c#2 edit
> > > ... //depot/dev/prom/cg/code/sm-pmonext2fs/freefs.c#1 edit
> > > ... //depot/dev/prom/cg/code/sm-pmonext2fs/inode.c#1 edit
> > > ... //depot/dev/prom/cg/code/sm-pmonext2fs/namei.c#1 edit
> > > ... //depot/dev/prom/cg/code/sm-pmonext2fs/openfs.c#3 edit
> > > ... //depot/dev/prom/cg/code/sm-pmonext2fs/pcmcia.c#5 edit
> > > ... //depot/dev/prom/cg/code/sm-pmonext2fs/pcmciavar.h#3 edit
> > > ... //depot/dev/prom/cg/code/sm-pmonext2fs/pmondisk.c#2 edit
> > > ... //depot/dev/prom/cg/code/sm-pmonext2fs/rw_bitmaps.c#2 edit
> > 
> > 
> > 
> > = Change 32139 by rendellf@rendellf-test on 2009/03/19 12:56:15
> > *pending* =
> > = 	TED26011: can't load kernel from second CF card (sdb1)
> > =
> > = 	Fixed disk controller register memory window address
> > mapping for second = 	card (socket B) to allow successive
> > file loading from either CF card. =
> > = 	Fixed device partition string check used for detecting
> > when partition is = 	already initialized.
> > =
> > = 	Changed eee memory mgmt routine definitions to make
> > ext2fs_get_mem() and = 	ext2fs_free_mem() work as intended.
> > =
> > 
> > prom/cg/code/sm-pmonext2fs/alloc.c
> > 
> >      line 115,142 probably best to just declare buf to be of type
> > void*, and then only have to put a single (char *) cast on line 118.
> Ok, done.
> 
> > 
> > prom/cg/code/sm-pmonext2fs/badblocks.c
> > 
> >      lines 24-33, are you putting in these casts to eliminate
> > warnings, or is it somehow producing bad code?
> If the cast is not done, the compiler generates tons of warnings and
> doesn't build.  If I could have gotten away without doing so, life
> would have been much simpler.
> 
> > 
> >      line 104, ok this is something weird.  if this "FUNCT" isn't
> >      implemented, then why not just comment out the whole FUNCT?
> >      there's something FUNCTy about this whole nonsense here that I
> >      don't get.
> > 
> >      again, what are the casts doing for you?
> It appears that the ext2fs_resize_mem routine is never being called.
> At least I've never seen a failure due to this cause.  So I've #ifdef
> it out for now.
> 
> > 
> > prom/cg/code/sm-pmonext2fs/bitmaps.c
> > 
> >      casts are good.  probably.  i just don't know why.
> > 
> > prom/cg/code/sm-pmonext2fs/block.c
> > 
> >      Beavis says: you put in a cast.  Heh.
> > 
> > prom/cg/code/sm-pmonext2fs/bmap.c
> > 
> >      ditto
> > 
> > prom/cg/code/sm-pmonext2fs/closefs.c
> > 
> >      dd
> > 
> > prom/cg/code/sm-pmonext2fs/dir_iterate.c
> > 
> >      dd
> > 
> > prom/cg/code/sm-pmonext2fs/dosio.c
> > 
> >      line 238-269ish, i don't get these changes at all, let's talk
> >      about them.
> The info in a partition entry is supposed to be setup only once when
> the device (/dev/sda1 or /dev/sdb1) is first accessed.  The original
> check didn't work.  Hence one partition entry is used (and never
> freed) each time a file load is executed.  Once the partitions[]
> address table is exceeded, a big time crash occurs.  The number of
> partition entries used never decrements upon completion of a file
> load.  Note memory allocation for the address table itself was also
> wrong. 
> 
> > 
> >      line 407-434, same goes here
> > 
> > prom/cg/code/sm-pmonext2fs/dosio.h
> > 
> >      line 24, why 2?  hey, even original DOS can handle 4.
> Only need 2 since there's only (/dev/sda1 and /dev/sdb1).  It can be
> increased to whatever you want but we only need 2 at the moment.
> 
> > 
> > prom/cg/code/sm-pmonext2fs/ext2fs.c
> > 
> >      line 224, there's too much debugging style output right now in
> >      the prom, let's comment this line out.
> Added debug_fs around it.
> 
> > 
> >      line 335, same deal.  we don't care if file close fails.
> >      we're only reading.
> Removed it.
> 
> > 
> > prom/cg/code/sm-pmonext2fs/ext2fs.h
> > 
> >      omg
> > 
> >      that's all i have to say.
> > 
> >      can we go through all this cruft?  i'd like to understand what
> >      you've learned here.
> The free_mem routine was originally commented out!!!  It's usually
> not a good thing.  Usage of the get_mem and free_mem routines clearly
> suggest to me that the allocated/freed memory address pointer was
> intended to be updated upon completion of the respective routine.
> Can't do that when the variable passed in is declared (void *).
> 
> So now upon completion of get_mem the ptr is updated with the
> allocated memory block address and NULLed out for free_mem.
> 
> > 
> > prom/cg/code/sm-pmonext2fs/fileio.c
> > 
> >      uhhh
> > 
> > prom/cg/code/sm-pmonext2fs/freefs.c
> > 
> >      er, let's do something so we don't have to edit 500 places
> > where ext2fs_get_mem is called...
> Any suggestions???
> 
> > 
> > prom/cg/code/sm-pmonext2fs/inode.c
> > 
> >      ditto
> > 
> > prom/cg/code/sm-pmonext2fs/namei.c
> > 
> >      ditto
> > 
> > prom/cg/code/sm-pmonext2fs/openfs.c
> > 
> >      ditto
> > 
> > prom/cg/code/sm-pmonext2fs/pcmcia.c
> > 
> >      excellent
> > 
> >      old line 2007: say whaaaaat?  that actually compiled?
> That code is #ifdef out.
> 
> > 
> >      line 1970: panic?  what does panic do in a PROM?
> Crash I suppose.
> 
> > 
> >      line 2036, shouldn't you return here?  or something to avoid
> >      possible bad dereferences later?
> We could do a return here.  From what I've seen nothing bad happens.
> It's just that all regs aren't mapped as expected.  No memory access
> error occurs just timeouts as you've seen.
> 
> > 
> >      would it be the end of the world to just delete all these #if
> >      0 blocks?
> I suppose I could.
> 
> > 
> > prom/cg/code/sm-pmonext2fs/pcmciavar.h
> > 
> >      looks good
> > 
> > prom/cg/code/sm-pmonext2fs/pmondisk.c
> > 
> >      line 31/32 ok.  phew.  i'm glad you swapped these two.  I'll
> > sleep well tonight.
> > 
> > 
> > prom/cg/code/sm-pmonext2fs/rw_bitmaps.c
> > 
> >      ditto like the others
> > 
> 
