Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 139149
b: refs/heads/master
c: 2584e51
h: refs/heads/master
i:
  139147: 1659dbd
v: v3
  • Loading branch information
Ravikiran G Thirumalai authored and Linus Torvalds committed Apr 1, 2009
1 parent 8780644 commit 6ec6c96
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8a0bdec194c21c8fdef840989d0d7b742bb5d4bc
refs/heads/master: 2584e517320bd48dc8d20e38a2621a2dbe58fade
12 changes: 12 additions & 0 deletions trunk/Documentation/feature-removal-schedule.txt
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,18 @@ Who: Vlad Yasevich <vladislav.yasevich@hp.com>

---------------------------

What: Ability for non root users to shm_get hugetlb pages based on mlock
resource limits
When: 2.6.31
Why: Non root users need to be part of /proc/sys/vm/hugetlb_shm_group or
have CAP_IPC_LOCK to be able to allocate shm segments backed by
huge pages. The mlock based rlimit check to allow shm hugetlb is
inconsistent with mmap based allocations. Hence it is being
deprecated.
Who: Ravikiran Thirumalai <kiran@scalex86.org>

---------------------------

What: CONFIG_THERMAL_HWMON
When: January 2009
Why: This option was introduced just to allow older lm-sensors userspace
Expand Down
13 changes: 11 additions & 2 deletions trunk/fs/hugetlbfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,7 @@ static int can_do_hugetlb_shm(void)
struct file *hugetlb_file_setup(const char *name, size_t size, int acctflag)
{
int error = -ENOMEM;
int unlock_shm = 0;
struct file *file;
struct inode *inode;
struct dentry *dentry, *root;
Expand All @@ -958,8 +959,14 @@ struct file *hugetlb_file_setup(const char *name, size_t size, int acctflag)
if (!hugetlbfs_vfsmount)
return ERR_PTR(-ENOENT);

if (!can_do_hugetlb_shm())
return ERR_PTR(-EPERM);
if (!can_do_hugetlb_shm()) {
if (user_shm_lock(size, user)) {
unlock_shm = 1;
WARN_ONCE(1,
"Using mlock ulimits for SHM_HUGETLB deprecated\n");
} else
return ERR_PTR(-EPERM);
}

root = hugetlbfs_vfsmount->mnt_root;
quick_string.name = name;
Expand Down Expand Up @@ -999,6 +1006,8 @@ struct file *hugetlb_file_setup(const char *name, size_t size, int acctflag)
out_dentry:
dput(dentry);
out_shm_unlock:
if (unlock_shm)
user_shm_unlock(size, user);
return ERR_PTR(error);
}

Expand Down

0 comments on commit 6ec6c96

Please sign in to comment.