Skip to content

Commit

Permalink
[IA64] use helpers for rlimits
Browse files Browse the repository at this point in the history
Make sure compiler won't do weird things with limits. E.g. fetching
them twice may return 2 different values after writable limits are
implemented.

I.e. either use rlimit helpers added in
3e10e71
or ACCESS_ONCE if not applicable.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
  • Loading branch information
Jiri Slaby authored and Tony Luck committed Jan 6, 2010
1 parent 1d1e9f0 commit 02b763b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arch/ia64/kernel/perfmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -2293,7 +2293,7 @@ pfm_smpl_buffer_alloc(struct task_struct *task, struct file *filp, pfm_context_t
* if ((mm->total_vm << PAGE_SHIFT) + len> task->rlim[RLIMIT_AS].rlim_cur)
* return -ENOMEM;
*/
if (size > task->signal->rlim[RLIMIT_MEMLOCK].rlim_cur)
if (size > task_rlimit(task, RLIMIT_MEMLOCK))
return -ENOMEM;

/*
Expand Down
2 changes: 1 addition & 1 deletion arch/ia64/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ dma_mark_clean(void *addr, size_t size)
inline void
ia64_set_rbs_bot (void)
{
unsigned long stack_size = current->signal->rlim[RLIMIT_STACK].rlim_max & -16;
unsigned long stack_size = rlimit_max(RLIMIT_STACK) & -16;

if (stack_size > MAX_USER_STACK_SIZE)
stack_size = MAX_USER_STACK_SIZE;
Expand Down

0 comments on commit 02b763b

Please sign in to comment.