From: Blaisorblade <blaisorblade@yahoo.it>
To: user-mode-linux-user@lists.sourceforge.net,
user-mode-linux-devel@lists.sourceforge.net,
Antoine Martin <antoine@nagafix.co.uk>
Cc: Jeff Dike <jdike@addtoit.com>, Joel Palmius <joel.palmius@miun.se>
Subject: [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)
Date: Tue, 20 Dec 2005 21:23:33 +0100 [thread overview]
Message-ID: <200512202123.34630.blaisorblade@yahoo.it> (raw)
In-Reply-To: <200512161703.14319.blaisorblade@yahoo.it>
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
next parent reply other threads:[~2005-12-20 20:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[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 ` Blaisorblade [this message]
2005-12-20 21:13 ` [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) Joel Palmius
2005-12-21 18:11 ` Blaisorblade
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200512202123.34630.blaisorblade@yahoo.it \
--to=blaisorblade@yahoo.it \
--cc=antoine@nagafix.co.uk \
--cc=jdike@addtoit.com \
--cc=joel.palmius@miun.se \
--cc=user-mode-linux-devel@lists.sourceforge.net \
--cc=user-mode-linux-user@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox