From: Russell Cattelan <cattelan@thebarn.com>
To: David Chinner <dgc@sgi.com>
Cc: Eric Sandeen <sandeen@sandeen.net>, xfs@oss.sgi.com
Subject: Re: [PATCH] (and bad attr2 bug) - pack xfs_sb_t for 64-bit arches
Date: Fri, 17 Nov 2006 09:53:49 -0600 [thread overview]
Message-ID: <455DDB0D.7000005@thebarn.com> (raw)
In-Reply-To: <20061116224527.GF11034@melbourne.sgi.com>
David Chinner wrote:
>
>@@ -135,9 +136,12 @@
> __uint8_t sb_shared_vn; /* shared version number */
> xfs_extlen_t sb_inoalignmt; /* inode chunk alignment, fsblocks */
> __uint32_t sb_unit; /* stripe or raid unit */
>- __uint32_t sb_width; /* stripe or raid width */
>+ __uint32_t sb_width; /* stripe or raid width */
> __uint8_t sb_dirblklog; /* log2 of dir block size (fsbs) */
>- __uint8_t sb_dummy[7]; /* padding */
>+ __uint8_t sb_logsectlog; /* log2 of the log sector size */
>+ __uint16_t sb_logsectsize; /* sector size for the log, bytes */
>+ __uint32_t sb_logsunit; /* stripe unit size for the log */
>+ __uint32_t sb_features2; /* additional feature bits */
> } xfs_sb_t;
>
>So before the sector size > 512 bytes code, there was padding to push the
>superblock out to 64bit alignement so that sb_dirblklog was correctly aligned.
>The xfs_sb_info structure:
>
> { offsetof(xfs_sb_t, sb_unit), 0 },
> { offsetof(xfs_sb_t, sb_width), 0 },
> { offsetof(xfs_sb_t, sb_dirblklog), 0 },
>- { offsetof(xfs_sb_t, sb_dummy), 1 },
>+ { offsetof(xfs_sb_t, sb_logsectlog), 0 },
>+ { offsetof(xfs_sb_t, sb_logsectsize),0 },
> { offsetof(xfs_sb_t, sb_logsunit), 0 },
>+ { offsetof(xfs_sb_t, sb_features2), 0 },
> { sizeof(xfs_sb_t), 0 }
> };
>
>had the sb_dummy field as "no translate" so it effectively ignored it
>but it ensured that sb_dirblklog was sized correctly.
>
>The real bug here was whoever removed the dummy field and did not
>replace that with a comment ot say that the xfs_sb strucutre needs
>to be padded to 64 bits to ensure translation worked properly
>on 64 bit systems.
>
>I'd prefer explicit padding (with warning comments) over packing
>the structure. Thoughts?
>
>
That seems safer to me and the comments will make the next person to
muck with
the structure think about padding.
>Cheers,
>
>Dave.
>
>
next prev parent reply other threads:[~2006-11-17 15:54 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-16 19:00 [PATCH] (and bad attr2 bug) - pack xfs_sb_t for 64-bit arches Eric Sandeen
2006-11-16 22:10 ` Eric Sandeen
2006-11-20 3:50 ` Eric Sandeen
2006-11-21 4:02 ` Eric Sandeen
2006-11-22 1:02 ` Russell Cattelan
2006-11-22 8:59 ` Timothy Shimmin
2006-11-22 15:44 ` Eric Sandeen
2006-11-22 16:24 ` Russell Cattelan
2006-11-22 16:38 ` Eric Sandeen
2006-11-23 7:09 ` Timothy Shimmin
2006-11-23 17:37 ` Russell Cattelan
2006-11-24 4:47 ` Timothy Shimmin
2006-11-27 12:50 ` Tim Shimmin
2006-11-29 9:56 ` [PATCH] attr2 patch for data btrees & attr 2 was: " Timothy Shimmin
2006-11-23 22:49 ` [PATCH] " David Chinner
2006-11-16 22:45 ` David Chinner
2006-11-16 22:55 ` Eric Sandeen
2006-11-17 15:53 ` Russell Cattelan [this message]
2006-11-17 1:08 ` Timothy Shimmin
2006-11-17 2:39 ` David Chinner
2006-11-17 4:11 ` Timothy Shimmin
2006-11-17 5:55 ` David Chinner
2006-11-17 6:34 ` sandeen
2006-11-17 6:52 ` Nathan Scott
2006-11-17 15:20 ` sandeen
2006-11-19 23:11 ` Nathan Scott
2006-11-20 1:39 ` Eric Sandeen
2006-11-20 3:00 ` Nathan Scott
2006-11-20 3:32 ` Eric Sandeen
2006-11-20 3:37 ` Nathan Scott
2006-11-17 6:58 ` David Chinner
2006-11-17 23:49 ` Eric Sandeen
2007-05-17 14:41 ` Eric Sandeen
2007-05-21 7:42 ` David Chinner
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=455DDB0D.7000005@thebarn.com \
--to=cattelan@thebarn.com \
--cc=dgc@sgi.com \
--cc=sandeen@sandeen.net \
--cc=xfs@oss.sgi.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.