diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-13 01:45:43 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-13 01:45:43 -0500 |
commit | 5cbb3d216e2041700231bcfc383ee5f8b7fc8b74 (patch) | |
tree | a738fa82dbcefa9bd283c08bc67f38827be63937 /ipc | |
parent | 9bc9ccd7db1c9f043f75380b5a5b94912046a60e (diff) | |
parent | 4e9b45a19241354daec281d7a785739829b52359 (diff) |
Merge branch 'akpm' (patches from Andrew Morton)
Merge first patch-bomb from Andrew Morton:
"Quite a lot of other stuff is banked up awaiting further
next->mainline merging, but this batch contains:
- Lots of random misc patches
- OCFS2
- Most of MM
- backlight updates
- lib/ updates
- printk updates
- checkpatch updates
- epoll tweaking
- rtc updates
- hfs
- hfsplus
- documentation
- procfs
- update gcov to gcc-4.7 format
- IPC"
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (269 commits)
ipc, msg: fix message length check for negative values
ipc/util.c: remove unnecessary work pending test
devpts: plug the memory leak in kill_sb
./Makefile: export initial ramdisk compression config option
init/Kconfig: add option to disable kernel compression
drivers: w1: make w1_slave::flags long to avoid memory corruption
drivers/w1/masters/ds1wm.cuse dev_get_platdata()
drivers/memstick/core/ms_block.c: fix unreachable state in h_msb_read_page()
drivers/memstick/core/mspro_block.c: fix attributes array allocation
drivers/pps/clients/pps-gpio.c: remove redundant of_match_ptr
kernel/panic.c: reduce 1 byte usage for print tainted buffer
gcov: reuse kbasename helper
kernel/gcov/fs.c: use pr_warn()
kernel/module.c: use pr_foo()
gcov: compile specific gcov implementation based on gcc version
gcov: add support for gcc 4.7 gcov format
gcov: move gcov structs definitions to a gcc version specific file
kernel/taskstats.c: return -ENOMEM when alloc memory fails in add_del_listener()
kernel/taskstats.c: add nla_nest_cancel() for failure processing between nla_nest_start() and nla_nest_end()
kernel/sysctl_binary.c: use scnprintf() instead of snprintf()
...
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/msgutil.c | 20 | ||||
-rw-r--r-- | ipc/util.c | 4 | ||||
-rw-r--r-- | ipc/util.h | 4 |
3 files changed, 13 insertions, 15 deletions
diff --git a/ipc/msgutil.c b/ipc/msgutil.c index 491e71f2a1b8..7e7095974d54 100644 --- a/ipc/msgutil.c +++ b/ipc/msgutil.c | |||
@@ -41,15 +41,15 @@ struct msg_msgseg { | |||
41 | /* the next part of the message follows immediately */ | 41 | /* the next part of the message follows immediately */ |
42 | }; | 42 | }; |
43 | 43 | ||
44 | #define DATALEN_MSG (int)(PAGE_SIZE-sizeof(struct msg_msg)) | 44 | #define DATALEN_MSG ((size_t)PAGE_SIZE-sizeof(struct msg_msg)) |
45 | #define DATALEN_SEG (int)(PAGE_SIZE-sizeof(struct msg_msgseg)) | 45 | #define DATALEN_SEG ((size_t)PAGE_SIZE-sizeof(struct msg_msgseg)) |
46 | 46 | ||
47 | 47 | ||
48 | static struct msg_msg *alloc_msg(int len) | 48 | static struct msg_msg *alloc_msg(size_t len) |
49 | { | 49 | { |
50 | struct msg_msg *msg; | 50 | struct msg_msg *msg; |
51 | struct msg_msgseg **pseg; | 51 | struct msg_msgseg **pseg; |
52 | int alen; | 52 | size_t alen; |
53 | 53 | ||
54 | alen = min(len, DATALEN_MSG); | 54 | alen = min(len, DATALEN_MSG); |
55 | msg = kmalloc(sizeof(*msg) + alen, GFP_KERNEL); | 55 | msg = kmalloc(sizeof(*msg) + alen, GFP_KERNEL); |
@@ -80,12 +80,12 @@ out_err: | |||
80 | return NULL; | 80 | return NULL; |
81 | } | 81 | } |
82 | 82 | ||
83 | struct msg_msg *load_msg(const void __user *src, int len) | 83 | struct msg_msg *load_msg(const void __user *src, size_t len) |
84 | { | 84 | { |
85 | struct msg_msg *msg; | 85 | struct msg_msg *msg; |
86 | struct msg_msgseg *seg; | 86 | struct msg_msgseg *seg; |
87 | int err = -EFAULT; | 87 | int err = -EFAULT; |
88 | int alen; | 88 | size_t alen; |
89 | 89 | ||
90 | msg = alloc_msg(len); | 90 | msg = alloc_msg(len); |
91 | if (msg == NULL) | 91 | if (msg == NULL) |
@@ -117,8 +117,8 @@ out_err: | |||
117 | struct msg_msg *copy_msg(struct msg_msg *src, struct msg_msg *dst) | 117 | struct msg_msg *copy_msg(struct msg_msg *src, struct msg_msg *dst) |
118 | { | 118 | { |
119 | struct msg_msgseg *dst_pseg, *src_pseg; | 119 | struct msg_msgseg *dst_pseg, *src_pseg; |
120 | int len = src->m_ts; | 120 | size_t len = src->m_ts; |
121 | int alen; | 121 | size_t alen; |
122 | 122 | ||
123 | BUG_ON(dst == NULL); | 123 | BUG_ON(dst == NULL); |
124 | if (src->m_ts > dst->m_ts) | 124 | if (src->m_ts > dst->m_ts) |
@@ -147,9 +147,9 @@ struct msg_msg *copy_msg(struct msg_msg *src, struct msg_msg *dst) | |||
147 | return ERR_PTR(-ENOSYS); | 147 | return ERR_PTR(-ENOSYS); |
148 | } | 148 | } |
149 | #endif | 149 | #endif |
150 | int store_msg(void __user *dest, struct msg_msg *msg, int len) | 150 | int store_msg(void __user *dest, struct msg_msg *msg, size_t len) |
151 | { | 151 | { |
152 | int alen; | 152 | size_t alen; |
153 | struct msg_msgseg *seg; | 153 | struct msg_msgseg *seg; |
154 | 154 | ||
155 | alen = min(len, DATALEN_MSG); | 155 | alen = min(len, DATALEN_MSG); |
diff --git a/ipc/util.c b/ipc/util.c index 7684f41bce76..3ae17a4ace5b 100644 --- a/ipc/util.c +++ b/ipc/util.c | |||
@@ -90,10 +90,8 @@ static int ipc_memory_callback(struct notifier_block *self, | |||
90 | * In order not to keep the lock on the hotplug memory chain | 90 | * In order not to keep the lock on the hotplug memory chain |
91 | * for too long, queue a work item that will, when waken up, | 91 | * for too long, queue a work item that will, when waken up, |
92 | * activate the ipcns notification chain. | 92 | * activate the ipcns notification chain. |
93 | * No need to keep several ipc work items on the queue. | ||
94 | */ | 93 | */ |
95 | if (!work_pending(&ipc_memory_wq)) | 94 | schedule_work(&ipc_memory_wq); |
96 | schedule_work(&ipc_memory_wq); | ||
97 | break; | 95 | break; |
98 | case MEM_GOING_ONLINE: | 96 | case MEM_GOING_ONLINE: |
99 | case MEM_GOING_OFFLINE: | 97 | case MEM_GOING_OFFLINE: |
diff --git a/ipc/util.h b/ipc/util.h index f2f5036f2eed..59d78aa94987 100644 --- a/ipc/util.h +++ b/ipc/util.h | |||
@@ -148,9 +148,9 @@ int ipc_parse_version (int *cmd); | |||
148 | #endif | 148 | #endif |
149 | 149 | ||
150 | extern void free_msg(struct msg_msg *msg); | 150 | extern void free_msg(struct msg_msg *msg); |
151 | extern struct msg_msg *load_msg(const void __user *src, int len); | 151 | extern struct msg_msg *load_msg(const void __user *src, size_t len); |
152 | extern struct msg_msg *copy_msg(struct msg_msg *src, struct msg_msg *dst); | 152 | extern struct msg_msg *copy_msg(struct msg_msg *src, struct msg_msg *dst); |
153 | extern int store_msg(void __user *dest, struct msg_msg *msg, int len); | 153 | extern int store_msg(void __user *dest, struct msg_msg *msg, size_t len); |
154 | 154 | ||
155 | extern void recompute_msgmni(struct ipc_namespace *); | 155 | extern void recompute_msgmni(struct ipc_namespace *); |
156 | 156 | ||