linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Richard Curnow <Richard.Curnow@superh.com>
To: Trond Myklebust <trond.myklebust@fys.uio.no>,
	Marcelo Tosatti <marcelo@conectiva.com.br>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Paul Mundt <lethal@linux-sh.org>,
	Ben Gaster <Benedict.Gaster@superh.com>,
	Sean McGoogan <sean.mcgoogan@superh.com>,
	Boyd Moffat <boyd.moffat@superh.com>
Subject: NFS structure allocation alignment patch
Date: Mon, 30 Jun 2003 14:52:33 +0100	[thread overview]
Message-ID: <20030630135233.GN5586@malvern.uk.w2k.superh.com> (raw)

Hi Trond, Marcelo,

Below is a patch against 2.4.21 to tidy up the allocation of two
structures in nfs3_proc_unlink_setup.  We need this change for NFS to
work on the sh64 architecture, which has just been merged into 2.4 in
the last couple of days.  Otherwise, 'res' is 4-byte aligned but not
necessarily 8-byte aligned, but struct nfs_attr contains fields that are
8 bytes wide.  This leads to alignment exceptions on loads and stores
into that structure.

Can you consider this for inclusion before 2.4.22 please?

[BTW this is the same fix we discussed about 3 months ago; I didn't get
around to re-submitting the fix at the time].

Regards,
Richard Curnow

--- fs/nfs/nfs3proc.c   Thu Nov 28 23:53:15 2002
+++ ../sh5linux-16062003/fs/nfs/nfs3proc.c      Mon Jun 30 11:43:14 2003
@@ -300,11 +300,16 @@
 {
        struct nfs3_diropargs   *arg;
        struct nfs_fattr        *res;
+       struct unlinkxdr {
+               struct nfs3_diropargs   arg;
+               struct nfs_fattr        res;
+       } *ptr;
 
-       arg = (struct nfs3_diropargs *)kmalloc(sizeof(*arg)+sizeof(*res), GFP_KERNEL);
-       if (!arg)
+       ptr = (struct unlinkxdr *) kmalloc(sizeof(struct unlinkxdr), GFP_KERNEL);
+       if (!ptr)
                return -ENOMEM;
-       res = (struct nfs_fattr*)(arg + 1);
+       arg = &ptr->arg;
+       res = &ptr->res;
        arg->fh = NFS_FH(dir->d_inode);
        arg->name = name->name;
        arg->len = name->len;

-- 
Richard \\\ SuperH Core+Debug Architect /// .. At home ..
  P.    /// richard.curnow@superh.com  ///  rc@rc0.org.uk
Curnow  \\\ http://www.superh.com/    ///  www.rc0.org.uk

             reply	other threads:[~2003-06-30 13:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-30 13:52 Richard Curnow [this message]
2003-07-10 11:05 ` NFS structure allocation alignment patch David Woodhouse
2003-07-16 15:03   ` Richard Curnow
2003-07-18 16:10     ` David Woodhouse

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=20030630135233.GN5586@malvern.uk.w2k.superh.com \
    --to=richard.curnow@superh.com \
    --cc=Benedict.Gaster@superh.com \
    --cc=boyd.moffat@superh.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    --cc=sean.mcgoogan@superh.com \
    --cc=trond.myklebust@fys.uio.no \
    /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;
as well as URLs for NNTP newsgroup(s).