Re: struct nfs_fattr alignment problem in nfs3proc.c

From: Trond Myklebust (trond.myklebust@fys.uio.no)
Date: Sat Mar 22 2003 - 06:00:16 EST


>>>>> " " == Richard Curnow <Richard.Curnow@superh.com> writes:

> In the nfs3_proc_unlink_setup function, there appears to be a
> bug with the way kmalloc is used to allocate storage for two
> structs grouped together. The second struct ends up with a non
> 8-byte aligned pointer, which can cause trouble later (in
> xdr_decode_fattr) when stores occur to the u64 fields inside
> it. The following patch (on 2.4.19) fixes this problem, though
> I'm not sure if it's the cleanest fix. (I hit this when
> working on the port to SH-5, which is currently baselined on
> 2.4.19).

Why not just define

struct {
        struct nfs3_diropargs arg;
        struct nfs_fattr res;
} unlinkxdr;

and then kmalloc that?

Cheers,
  Trond
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Mar 23 2003 - 22:00:40 EST