Re: [ext2resize] Ext2resize for big-endian (Ultrasparc)
Status: Inactive
Brought to you by:
adilger
From: Andreas D. <ad...@tu...> - 2001-03-21 21:15:07
|
Dave Wapstra writes: > I recently installed LVM on a Sun E450 and was experimenting with > ext2resize. After extending the logical volume, I extended my ext2 > filesystem, at least that was they idea. > > After messing up the filesystem a couple of times, I finally noticed > the little TODO list for ext2resize: > > misc todo > --------- > make it work on big-endian systems. I'm surprised you were even able to mess up the filesystem!!! It should have failed when checking the EXT2_MAGIC in the superblock, because of endian issues (at least that's what I assumed). I will have to ensure that we refuse to do anything on big-endian machines until this works properly. > I would like to work on making ext2resize work on big-endian (specifically > (ultra)sparc), but although I can hack a little C code, I have no idea > where to start on making ext2resize big-endian compliant. There are two ways to do this, and I'm not sure which is best: 1) leave the superblock and all on-disk data in little-endian format, and convert to machine endianness as needed. This is done in the kernel, but it may be because they are directly mapping on-disk data and have no control over when it is written to disk. 2) Convert the superblock and all on-disk data to machine endianness when it is read from disk. This would require new routines for read_super, read_GDT, read_inode, etc. This is what's done in the e2fsprogs libext2fs. There are a few cases (with data that isn't repeatedly accessed, like directory entries) where it keeps the data little-endian. It is worthwhile to hear from Andrew Clausen (parted author and user of a divergent libext2resize) to see what he has done in this regard. We could merge the endianness changes back into libext2resize. Cheers, Andreas -- Andreas Dilger \ "If a man ate a pound of pasta and a pound of antipasto, \ would they cancel out, leaving him still hungry?" http://www-mddsp.enel.ucalgary.ca/People/adilger/ -- Dogbert |