* [uml-devel] Re: Bug in COW format - 64-bit incompatible with 32-bit due to struct padding (was: Re: [uml-user] uml_moo and large files)
[not found] ` <200512161703.14319.blaisorblade@yahoo.it>
@ 2005-12-20 20:23 ` Blaisorblade
2005-12-20 21:13 ` Joel Palmius
0 siblings, 1 reply; 3+ messages in thread
From: Blaisorblade @ 2005-12-20 20:23 UTC (permalink / raw)
To: user-mode-linux-user, user-mode-linux-devel, Antoine Martin
Cc: Jeff Dike, Joel Palmius
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-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* [uml-devel] Re: Bug in COW format - 64-bit incompatible with 32-bit due to struct padding (was: Re: [uml-user] uml_moo and large files)
2005-12-20 20:23 ` [uml-devel] Re: Bug in COW format - 64-bit incompatible with 32-bit due to struct padding (was: Re: [uml-user] uml_moo and large files) Blaisorblade
@ 2005-12-20 21:13 ` Joel Palmius
2005-12-21 18:11 ` Blaisorblade
0 siblings, 1 reply; 3+ messages in thread
From: Joel Palmius @ 2005-12-20 21:13 UTC (permalink / raw)
To: Blaisorblade; +Cc: user-mode-linux-user, user-mode-linux-devel
On Tue, 20 Dec 2005, Blaisorblade wrote:
> 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.
Personally I stopped trusting COW files once I saw I couldn't moo them, so
I simply haven't used COWs. I guess most people trying COWs on an amd64
system with 32bit umls would reach the same conclusion pretty fast.
// Joel
-------------------------------------------------------
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-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* [uml-devel] Re: Bug in COW format - 64-bit incompatible with 32-bit due to struct padding (was: Re: [uml-user] uml_moo and large files)
2005-12-20 21:13 ` Joel Palmius
@ 2005-12-21 18:11 ` Blaisorblade
0 siblings, 0 replies; 3+ messages in thread
From: Blaisorblade @ 2005-12-21 18:11 UTC (permalink / raw)
To: Joel Palmius; +Cc: user-mode-linux-user, user-mode-linux-devel
On Tuesday 20 December 2005 22:13, Joel Palmius wrote:
> On Tue, 20 Dec 2005, Blaisorblade wrote:
> > 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.
> Personally I stopped trusting COW files once I saw I couldn't moo them, so
> I simply haven't used COWs. I guess most people trying COWs on an amd64
> system with 32bit umls would reach the same conclusion pretty fast.
I do exactly this, but I never use uml_moo (until the other day, when I saw
this crash, remembered your report and successfully debugged it).
--
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-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-12-21 18:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <Pine.LNX.4.63.0510161818210.10902@ligur.student.mh.se>
[not found] ` <20051215201530.GA10705@ccure.user-mode-linux.org>
[not found] ` <200512161703.14319.blaisorblade@yahoo.it>
2005-12-20 20:23 ` [uml-devel] Re: Bug in COW format - 64-bit incompatible with 32-bit due to struct padding (was: Re: [uml-user] uml_moo and large files) Blaisorblade
2005-12-20 21:13 ` Joel Palmius
2005-12-21 18:11 ` Blaisorblade
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox