summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@fys.uio.no>2004-09-02 04:53:29 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-09-02 04:53:29 -0700
commitf409ac776b966ef84d86f1822141fdd1b31710dc (patch)
treeade5c303dcb5930be586a2bdd25fcc52ced2bba1
parentda68991d5a924a3d7ed95893570cbd9da0e71d97 (diff)
[PATCH] NFSv3: Fix up an unaligned access error in nfs3_proc_unlink_setup()
Signed-off-by: Trond Myklebust <trond.myklebust@fys.uio.no> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--fs/nfs/nfs3proc.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
index 02ed47130467..6be08f678009 100644
--- a/fs/nfs/nfs3proc.c
+++ b/fs/nfs/nfs3proc.c
@@ -418,20 +418,21 @@ nfs3_proc_remove(struct inode *dir, struct qstr *name)
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(*ptr), GFP_KERNEL);
+ if (!ptr)
return -ENOMEM;
- res = (struct nfs_fattr*)(arg + 1);
- arg->fh = NFS_FH(dir->d_inode);
- arg->name = name->name;
- arg->len = name->len;
- res->valid = 0;
+ ptr->arg.fh = NFS_FH(dir->d_inode);
+ ptr->arg.name = name->name;
+ ptr->arg.len = name->len;
+ ptr->res.valid = 0;
msg->rpc_proc = &nfs3_procedures[NFS3PROC_REMOVE];
- msg->rpc_argp = arg;
- msg->rpc_resp = res;
+ msg->rpc_argp = &ptr->arg;
+ msg->rpc_resp = &ptr->res;
return 0;
}