> One thing I would like to know: can I drop into the 'mon' and set a break > point in the kernel code, then restart and trace when I hit the break point? > Does kernel trace works on PPC? I'll stfw for these info, but if you can > give me a quick pointer, I'll read and study that.
I'll have to refer this to BenH - I've only ever used xmon to try and resume after the system dropped into xmon due to some kernel bug. I believe there's a key combination (command-power?) to drop into xmon and poke around but I doubt breakpoints are possible. I agree there seems to be a timing issue or race - multiple sync() calls will only commit dirty buffers for flushing which waits for completion the first time called, so subsequent syncs are a nop unless something else gets buffers dirty (I had to look that up to be sure). The device invalidate used when rereading the partition table also waits for completion so I'm at a loss to explain this :-( One more thing to try: replace the sync with a BLKFLSBUF ioctl. That should only flush buffers for the device being partitioned, and definitely uses fsync_dev to wait for I/O completion. Michael