lkml.org 
[lkml]   [2012]   [Jul]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH] cgroup: cgroup_rm_files() was calling simple_unlink() with the wrong inode
    From 6da2689412c78b97716ec524cc30baf7b46508cd Mon Sep 17 00:00:00 2001
    From: Tejun Heo <tj@kernel.org>
    Date: Tue, 3 Jul 2012 10:32:26 -0700

    While refactoring cgroup file removal path, 05ef1d7c4a "cgroup:
    introduce struct cfent" incorrectly changed the @dir argument of
    simple_unlink() to the inode of the file being deleted instead of that
    of the containing directory.

    The effect of this bug is minor - ctime and mtime of the parent
    weren't properly updated on file deletion.

    Fix it by using @cgrp->dentry->d_inode instead.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
    ---
    Will commit to cgroup/for-3.5-fixes. Li, can you please ack this?

    Thanks.

    kernel/cgroup.c | 2 +-
    1 files changed, 1 insertions(+), 1 deletions(-)

    diff --git a/kernel/cgroup.c b/kernel/cgroup.c
    index 2097684..b214fc2 100644
    --- a/kernel/cgroup.c
    +++ b/kernel/cgroup.c
    @@ -964,7 +964,7 @@ static int cgroup_rm_file(struct cgroup *cgrp, const struct cftype *cft)

    dget(d);
    d_delete(d);
    - simple_unlink(d->d_inode, d);
    + simple_unlink(cgrp->dentry->d_inode, d);
    list_del_init(&cfe->node);
    dput(d);

    --
    1.7.7.3


    \
     
     \ /
      Last update: 2012-07-03 19:41    [W:2.827 / U:0.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site