Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2010-02-12 11:10:51 -0500
committerJeff Mahoney <jeffm@suse.com>2010-02-12 11:10:51 -0500
commiteadf64e82462bc2a13466f153d5423f527713f15 (patch)
tree9a599fbc4069eec71d7f3d731d02f4273dcf298b
parent345589beadde9f01c1fa84984c9f1e356ce2fedc (diff)
- patches.fixes/taskstats-alignment: delayacct: align to 8 byte
boundary on 64-bit systems (bnc#578065). suse-commit: 639cb8edb27127dc196a65d9d3b77cf5784165c3
-rw-r--r--kernel/taskstats.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/kernel/taskstats.c b/kernel/taskstats.c
index 64d88d93b3b8..7b7d6ea77366 100644
--- a/kernel/taskstats.c
+++ b/kernel/taskstats.c
@@ -361,6 +361,12 @@ static struct taskstats *mk_reply(struct sk_buff *skb, int type, u32 pid)
struct nlattr *na, *ret;
int aggr;
+ /* If we don't pad, we end up with alignment on a 4 byte boundary.
+ * This causes lots of runtime warnings on systems requiring 8 byte
+ * alignment */
+ u32 pids[2] = { pid, 0 };
+ int pid_size = ALIGN(sizeof(pid), sizeof(long));
+
aggr = (type == TASKSTATS_TYPE_PID)
? TASKSTATS_TYPE_AGGR_PID
: TASKSTATS_TYPE_AGGR_TGID;
@@ -368,7 +374,7 @@ static struct taskstats *mk_reply(struct sk_buff *skb, int type, u32 pid)
na = nla_nest_start(skb, aggr);
if (!na)
goto err;
- if (nla_put(skb, type, sizeof(pid), &pid) < 0)
+ if (nla_put(skb, type, pid_size, pids) < 0)
goto err;
ret = nla_reserve(skb, TASKSTATS_TYPE_STATS, sizeof(struct taskstats));
if (!ret)
@@ -432,12 +438,6 @@ static int taskstats_user_cmd(struct sk_buff *skb, struct genl_info *info)
struct taskstats *stats;
size_t size;
cpumask_var_t mask;
-#ifdef CONFIG_IA64
- struct taskstats statn;
-#define statf &statn
-#else
-#define statf stats
-#endif
if (!alloc_cpumask_var(&mask, GFP_KERNEL))
return -ENOMEM;
@@ -478,7 +478,7 @@ free_return_rc:
if (!stats)
goto err;
- rc = fill_pid(pid, NULL, statf);
+ rc = fill_pid(pid, NULL, stats);
if (rc < 0)
goto err;
} else if (info->attrs[TASKSTATS_CMD_ATTR_TGID]) {
@@ -487,15 +487,12 @@ free_return_rc:
if (!stats)
goto err;
- rc = fill_tgid(tgid, NULL, statf);
+ rc = fill_tgid(tgid, NULL, stats);
if (rc < 0)
goto err;
} else
goto err;
-#ifdef CONFIG_IA64
- memcpy(stats, &statn, sizeof(statn));
-#endif
return send_reply(rep_skb, info);
err:
nlmsg_free(rep_skb);