From 7aae01fae5c7d96e737262b5ac1778ae4c2579ce Mon Sep 17 00:00:00 2001 From: Li Zefan Date: Wed, 19 Nov 2008 15:36:48 -0800 Subject: [PATCH] --- yaml --- r: 119201 b: refs/heads/master c: 33d283bef23132c48195eafc21449f8ba88fce6b h: refs/heads/master i: 119199: 5e0b13182aaec20353173e326c3f5afa9bf912ac v: v3 --- [refs] | 2 +- trunk/kernel/cgroup.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 367d95470f9d..037102ffdbd9 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ea7e743e49b94749fc739baaf160809ed279aeda +refs/heads/master: 33d283bef23132c48195eafc21449f8ba88fce6b diff --git a/trunk/kernel/cgroup.c b/trunk/kernel/cgroup.c index 1a06be61dcd0..fe00b3b983a8 100644 --- a/trunk/kernel/cgroup.c +++ b/trunk/kernel/cgroup.c @@ -2039,10 +2039,13 @@ int cgroupstats_build(struct cgroupstats *stats, struct dentry *dentry) struct cgroup *cgrp; struct cgroup_iter it; struct task_struct *tsk; + /* - * Validate dentry by checking the superblock operations + * Validate dentry by checking the superblock operations, + * and make sure it's a directory. */ - if (dentry->d_sb->s_op != &cgroup_ops) + if (dentry->d_sb->s_op != &cgroup_ops || + !S_ISDIR(dentry->d_inode->i_mode)) goto err; ret = 0;