From: Mans Rullgard Date: Sat, 28 Mar 2009 19:55:20 +0000 (+0000) Subject: NSM: Fix unaligned accesses in nsm_init_private() X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=ad5b365c1266b0c9e8e254a3c1cc4ef66bf33cba;p=linux-2.6-omap-h63xx.git NSM: Fix unaligned accesses in nsm_init_private() This fixes unaligned accesses in nsm_init_private() when creating nlm_reboot keys. Signed-off-by: Mans Rullgard Reviewed-by: Chuck Lever Signed-off-by: Trond Myklebust --- diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c index 5e2c4d5ac82..6d5d4a4169e 100644 --- a/fs/lockd/mon.c +++ b/fs/lockd/mon.c @@ -16,6 +16,8 @@ #include #include +#include + #define NLMDBG_FACILITY NLMDBG_MONITOR #define NSM_PROGRAM 100024 #define NSM_VERSION 1 @@ -274,10 +276,12 @@ static void nsm_init_private(struct nsm_handle *nsm) { u64 *p = (u64 *)&nsm->sm_priv.data; struct timespec ts; + s64 ns; ktime_get_ts(&ts); - *p++ = timespec_to_ns(&ts); - *p = (unsigned long)nsm; + ns = timespec_to_ns(&ts); + put_unaligned(ns, p); + put_unaligned((unsigned long)nsm, p + 1); } static struct nsm_handle *nsm_create_handle(const struct sockaddr *sap,