diff options
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/compat.c | 1 | ||||
-rw-r--r-- | ipc/sem.c | 19 | ||||
-rw-r--r-- | ipc/shm.c | 2 | ||||
-rw-r--r-- | ipc/util.h | 2 |
4 files changed, 9 insertions, 15 deletions
diff --git a/ipc/compat.c b/ipc/compat.c index 70e4e4e10f..3881d564c6 100644 --- a/ipc/compat.c +++ b/ipc/compat.c | |||
@@ -572,6 +572,7 @@ static inline int put_compat_shminfo(struct shminfo64 *smi, | |||
572 | err |= __put_user(smi->shmmni, &up->shmmni); | 572 | err |= __put_user(smi->shmmni, &up->shmmni); |
573 | err |= __put_user(smi->shmseg, &up->shmseg); | 573 | err |= __put_user(smi->shmseg, &up->shmseg); |
574 | err |= __put_user(smi->shmall, &up->shmall); | 574 | err |= __put_user(smi->shmall, &up->shmall); |
575 | return err; | ||
575 | } | 576 | } |
576 | 577 | ||
577 | static inline int put_compat_shm_info(struct shm_info __user *ip, | 578 | static inline int put_compat_shm_info(struct shm_info __user *ip, |
@@ -895,7 +895,7 @@ static inline void lock_semundo(void) | |||
895 | struct sem_undo_list *undo_list; | 895 | struct sem_undo_list *undo_list; |
896 | 896 | ||
897 | undo_list = current->sysvsem.undo_list; | 897 | undo_list = current->sysvsem.undo_list; |
898 | if ((undo_list != NULL) && (atomic_read(&undo_list->refcnt) != 1)) | 898 | if (undo_list) |
899 | spin_lock(&undo_list->lock); | 899 | spin_lock(&undo_list->lock); |
900 | } | 900 | } |
901 | 901 | ||
@@ -915,7 +915,7 @@ static inline void unlock_semundo(void) | |||
915 | struct sem_undo_list *undo_list; | 915 | struct sem_undo_list *undo_list; |
916 | 916 | ||
917 | undo_list = current->sysvsem.undo_list; | 917 | undo_list = current->sysvsem.undo_list; |
918 | if ((undo_list != NULL) && (atomic_read(&undo_list->refcnt) != 1)) | 918 | if (undo_list) |
919 | spin_unlock(&undo_list->lock); | 919 | spin_unlock(&undo_list->lock); |
920 | } | 920 | } |
921 | 921 | ||
@@ -943,9 +943,7 @@ static inline int get_undo_list(struct sem_undo_list **undo_listp) | |||
943 | if (undo_list == NULL) | 943 | if (undo_list == NULL) |
944 | return -ENOMEM; | 944 | return -ENOMEM; |
945 | memset(undo_list, 0, size); | 945 | memset(undo_list, 0, size); |
946 | /* don't initialize unodhd->lock here. It's done | 946 | spin_lock_init(&undo_list->lock); |
947 | * in copy_semundo() instead. | ||
948 | */ | ||
949 | atomic_set(&undo_list->refcnt, 1); | 947 | atomic_set(&undo_list->refcnt, 1); |
950 | current->sysvsem.undo_list = undo_list; | 948 | current->sysvsem.undo_list = undo_list; |
951 | } | 949 | } |
@@ -1054,7 +1052,7 @@ asmlinkage long sys_semtimedop(int semid, struct sembuf __user *tsops, | |||
1054 | struct sembuf fast_sops[SEMOPM_FAST]; | 1052 | struct sembuf fast_sops[SEMOPM_FAST]; |
1055 | struct sembuf* sops = fast_sops, *sop; | 1053 | struct sembuf* sops = fast_sops, *sop; |
1056 | struct sem_undo *un; | 1054 | struct sem_undo *un; |
1057 | int undos = 0, decrease = 0, alter = 0, max; | 1055 | int undos = 0, alter = 0, max; |
1058 | struct sem_queue queue; | 1056 | struct sem_queue queue; |
1059 | unsigned long jiffies_left = 0; | 1057 | unsigned long jiffies_left = 0; |
1060 | 1058 | ||
@@ -1089,13 +1087,10 @@ asmlinkage long sys_semtimedop(int semid, struct sembuf __user *tsops, | |||
1089 | if (sop->sem_num >= max) | 1087 | if (sop->sem_num >= max) |
1090 | max = sop->sem_num; | 1088 | max = sop->sem_num; |
1091 | if (sop->sem_flg & SEM_UNDO) | 1089 | if (sop->sem_flg & SEM_UNDO) |
1092 | undos++; | 1090 | undos = 1; |
1093 | if (sop->sem_op < 0) | 1091 | if (sop->sem_op != 0) |
1094 | decrease = 1; | ||
1095 | if (sop->sem_op > 0) | ||
1096 | alter = 1; | 1092 | alter = 1; |
1097 | } | 1093 | } |
1098 | alter |= decrease; | ||
1099 | 1094 | ||
1100 | retry_undos: | 1095 | retry_undos: |
1101 | if (undos) { | 1096 | if (undos) { |
@@ -1234,8 +1229,6 @@ int copy_semundo(unsigned long clone_flags, struct task_struct *tsk) | |||
1234 | error = get_undo_list(&undo_list); | 1229 | error = get_undo_list(&undo_list); |
1235 | if (error) | 1230 | if (error) |
1236 | return error; | 1231 | return error; |
1237 | if (atomic_read(&undo_list->refcnt) == 1) | ||
1238 | spin_lock_init(&undo_list->lock); | ||
1239 | atomic_inc(&undo_list->refcnt); | 1232 | atomic_inc(&undo_list->refcnt); |
1240 | tsk->sysvsem.undo_list = undo_list; | 1233 | tsk->sysvsem.undo_list = undo_list; |
1241 | } else | 1234 | } else |
@@ -170,7 +170,7 @@ static struct vm_operations_struct shm_vm_ops = { | |||
170 | .open = shm_open, /* callback for a new vm-area open */ | 170 | .open = shm_open, /* callback for a new vm-area open */ |
171 | .close = shm_close, /* callback for when the vm-area is released */ | 171 | .close = shm_close, /* callback for when the vm-area is released */ |
172 | .nopage = shmem_nopage, | 172 | .nopage = shmem_nopage, |
173 | #ifdef CONFIG_NUMA | 173 | #if defined(CONFIG_NUMA) && defined(CONFIG_SHMEM) |
174 | .set_policy = shmem_set_policy, | 174 | .set_policy = shmem_set_policy, |
175 | .get_policy = shmem_get_policy, | 175 | .get_policy = shmem_get_policy, |
176 | #endif | 176 | #endif |
diff --git a/ipc/util.h b/ipc/util.h index 07d6894523..44348ca5a7 100644 --- a/ipc/util.h +++ b/ipc/util.h | |||
@@ -67,7 +67,7 @@ int ipc_checkid(struct ipc_ids* ids, struct kern_ipc_perm* ipcp, int uid); | |||
67 | void kernel_to_ipc64_perm(struct kern_ipc_perm *in, struct ipc64_perm *out); | 67 | void kernel_to_ipc64_perm(struct kern_ipc_perm *in, struct ipc64_perm *out); |
68 | void ipc64_perm_to_ipc_perm(struct ipc64_perm *in, struct ipc_perm *out); | 68 | void ipc64_perm_to_ipc_perm(struct ipc64_perm *in, struct ipc_perm *out); |
69 | 69 | ||
70 | #if defined(__ia64__) || defined(__x86_64__) || defined(__hppa__) | 70 | #if defined(__ia64__) || defined(__x86_64__) || defined(__hppa__) || defined(__XTENSA__) |
71 | /* On IA-64, we always use the "64-bit version" of the IPC structures. */ | 71 | /* On IA-64, we always use the "64-bit version" of the IPC structures. */ |
72 | # define ipc_parse_version(cmd) IPC_64 | 72 | # define ipc_parse_version(cmd) IPC_64 |
73 | #else | 73 | #else |