diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2012-02-08 00:41:24 +0100 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2012-05-15 23:59:27 +0200 |
commit | 1523299d5817773e344d135d4b1c485f269400bc (patch) | |
tree | eef0768f5418facb1d37dbe99f346b9d77223f9f /fs/ext3/balloc.c | |
parent | userns: Convert ext2 to use kuid/kgid where appropriate. (diff) | |
download | linux-1523299d5817773e344d135d4b1c485f269400bc.tar.xz linux-1523299d5817773e344d135d4b1c485f269400bc.zip |
userns: Convert ext3 to use kuid/kgid where appropriate
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'fs/ext3/balloc.c')
-rw-r--r-- | fs/ext3/balloc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c index baac1b129fba..25cd60892116 100644 --- a/fs/ext3/balloc.c +++ b/fs/ext3/balloc.c @@ -1439,8 +1439,9 @@ static int ext3_has_free_blocks(struct ext3_sb_info *sbi, int use_reservation) free_blocks = percpu_counter_read_positive(&sbi->s_freeblocks_counter); root_blocks = le32_to_cpu(sbi->s_es->s_r_blocks_count); if (free_blocks < root_blocks + 1 && !capable(CAP_SYS_RESOURCE) && - !use_reservation && sbi->s_resuid != current_fsuid() && - (sbi->s_resgid == 0 || !in_group_p (sbi->s_resgid))) { + !use_reservation && !uid_eq(sbi->s_resuid, current_fsuid()) && + (gid_eq(sbi->s_resgid, GLOBAL_ROOT_GID) || + !in_group_p (sbi->s_resgid))) { return 0; } return 1; |