public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: "'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>
Cc: Evgeniy Dushistov <dushistov@mail.ru>
Subject: [PATCH] fix UFS superblock alignment issues
Date: Mon, 30 Oct 2006 21:46:09 -0600	[thread overview]
Message-ID: <4546C701.9020707@redhat.com> (raw)

ufs2 fails to mount on x86_64, claiming bad magic.  This is because 
ufs_super_block_third's fs_un1 member is padded out by 4 bytes for
8-byte alignment, pushing down the rest of the struct.

Forcing this to be packed solves it.  I took a quick look over
other on-disk structures and didn't immediately find other problems.
I was able to mount & ls a populated ufs2 filesystem w/ this change.

Thanks,
-Eric

Signed-off-by: Eric Sandeen <sandeen@redhat.com>

Index: linux-2.6.18/include/linux/ufs_fs.h
===================================================================
--- linux-2.6.18.orig/include/linux/ufs_fs.h
+++ linux-2.6.18/include/linux/ufs_fs.h
@@ -900,7 +900,7 @@ struct ufs_super_block_third {
 			__fs64   fs_csaddr;	/* blk addr of cyl grp summary area */
 			__fs64    fs_pendingblocks;/* blocks in process of being freed */
 			__fs32    fs_pendinginodes;/*inodes in process of being freed */
-		} fs_u2;
+		} __attribute__ ((packed)) fs_u2;
 	} fs_un1;
 	union {
 		struct {



             reply	other threads:[~2006-10-31  3:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-31  3:46 Eric Sandeen [this message]
2006-10-31 15:22 ` [PATCH] fix UFS superblock alignment issues Eric Sandeen
2006-10-31 15:54   ` Randy Dunlap

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=4546C701.9020707@redhat.com \
    --to=sandeen@redhat.com \
    --cc=dushistov@mail.ru \
    --cc=linux-kernel@vger.kernel.org \
    /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