From: Richard Curnow <Richard.Curnow@superh.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: struct nfs_fattr alignment problem in nfs3proc.c
Date: Mon, 24 Mar 2003 13:49:27 +0000 [thread overview]
Message-ID: <20030324134927.GC17163@malvern.uk.w2k.superh.com> (raw)
In-Reply-To: <20030324120923.GB17163@malvern.uk.w2k.superh.com>
* Richard Curnow <Richard.Curnow@superh.com> [2003-03-24]:
> + struct unlinkxdr {
> + struct nfs3_diropargs *arg;
> + struct nfs_fattr *res;
> + } *ptr;
Sorry, those asterisks are not good. Instead:
--- ../linux-2.4/fs/nfs/nfs3proc.c Fri Jan 3 15:01:17 2003
+++ fs/nfs/nfs3proc.c Mon Mar 24 13:06:36 2003
@@ -294,25 +294,36 @@
nfs_refresh_inode(dir, &dir_attr);
dprintk("NFS reply remove: %d\n", status);
return status;
}
static int
nfs3_proc_unlink_setup(struct rpc_message *msg, struct dentry *dir, struct qstr *name)
{
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;
+ if (((unsigned long) arg & 0x7) != 0) {
+ printk("nfs3_proc_unlink_setup : arg not 8-byte aligned!\n");
+ }
+ if (((unsigned long) res & 0x7) != 0) {
+ printk("nfs3_proc_unlink_setup : res not 8-byte aligned!\n");
+ }
arg->fh = NFS_FH(dir->d_inode);
arg->name = name->name;
arg->len = name->len;
res->valid = 0;
msg->rpc_proc = NFS3PROC_REMOVE;
msg->rpc_argp = arg;
msg->rpc_resp = res;
return 0;
}
--
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
Speaking for myself, not on behalf of SuperH
next prev parent reply other threads:[~2003-03-24 13:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-21 17:52 Richard Curnow
2003-03-22 11:00 ` Trond Myklebust
2003-03-24 12:09 ` Richard Curnow
2003-03-24 13:49 ` Richard Curnow [this message]
2003-03-24 14:06 ` Trond Myklebust
2003-03-24 14:21 ` Richard Curnow
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=20030324134927.GC17163@malvern.uk.w2k.superh.com \
--to=richard.curnow@superh.com \
--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
all inboxes | Powered by JetHome®