On Friday 16 December 2005 17:03, Blaisorblade wrote: > On Thursday 15 December 2005 21:15, Jeff Dike wrote: > > On Thu, Dec 15, 2005 at 05:26:44PM +0100, Blaisorblade wrote:
> We want a utility read-wrong-V3-header / write right one. I have this support - indeed I've integrated the code to recognize (as suggested below) and read correctly a 64-bit V3 COW. This means that: a) uml_moo will safely read 64-bit V3 COW and emit a warning b) the fixed Uml kernel will do a transparent conversion (and emit the same warning). But it will also modify the files. So we need an utility doing just the setup and the writeout. Should be easy to do, but I must learn the complete COW API. I will dismiss this task if I see (as it seems) that there are no existing COW files. > At that point (see below) 64-bit buggy programs (uml_moo and kernel) will > crash (SIGFPE) on correct V3 COWs. (And unlike real cows, crashing on COWs > doesn't hurt the obstacle). I've also tested the reverse case - uml_moo complains "Stating backing file: No such file or directory" - it doesn't find the backing file because of the leading zeros I described in the the ->backing_file field: > c) it should be possible Indeed this works. > to distinguish between broken 64-bit and 32-bit V3 > files, with the following line: > > if ( *((int*)header->backing_file) == 0) > printf("Hey, broken V3 file with 64-bit\n"); > Broken 64-bit has 4 bytes of extra padding after ->mtime and before ->size: In this I was wrong - this happens only in the kernel (which has __u32 mtime). The original V3 header uses time_t, which is a long (64-bit). Jeff Dike (IIRC) fixed this in the kernel, but didn't note the alignment. So I additionally used __u32 for mtime. > struct cow_header_v3 { > __u32 magic; > __u32 version; > time_t mtime; > __u64 size; > __u32 sectorsize; > __u32 alignment; > __u32 cow_format; > char backing_file[PATH_LEN_V3]; > }; > == Fig. 1 - cow_header_v3 layout (for easier reference) == -- Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!". Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894) http://www.user-mode-linux.org/~blaisorblade ___________________________________ Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB http://mail.yahoo.it ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ User-mode-linux-user mailing list User-mode-linux-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user