All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Al Viro <viro-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
Cc: Li Zefan <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>,
	shyju pv <shyju.pv-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Sanil kumar <sanil.kumar-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>,
	Masanari Iida
	<standby24x7-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: [PATCH] cgroup: cgroup_rm_files() was calling simple_unlink() with the wrong inode
Date: Tue, 3 Jul 2012 10:38:06 -0700	[thread overview]
Message-ID: <20120703173806.GD555@google.com> (raw)
In-Reply-To: <20120703171033.GC555-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>

From 6da2689412c78b97716ec524cc30baf7b46508cd Mon Sep 17 00:00:00 2001
From: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Reported-by: Al Viro <viro-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
---
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

WARNING: multiple messages have this Message-ID (diff)
From: Tejun Heo <tj@kernel.org>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Li Zefan <lizefan@huawei.com>, shyju pv <shyju.pv@huawei.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"cgroups@vger.kernel.org" <cgroups@vger.kernel.org>,
	Sanil kumar <sanil.kumar@huawei.com>,
	Masanari Iida <standby24x7@gmail.com>
Subject: [PATCH] cgroup: cgroup_rm_files() was calling simple_unlink() with the wrong inode
Date: Tue, 3 Jul 2012 10:38:06 -0700	[thread overview]
Message-ID: <20120703173806.GD555@google.com> (raw)
In-Reply-To: <20120703171033.GC555@google.com>

>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


  parent reply	other threads:[~2012-07-03 17:38 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-24 19:08 3.5-rc3: BUG: Dentry still in use (1) [unmount of cgroup cgroup] shyju pv
2012-06-24 19:08 ` shyju pv
     [not found] ` <E061084CB90FCE4F89232A6CF839683B32B52291-SY/3K1LPFSqBBfbIEMVH7QK1hpo4iccwjNknBlVQO8k@public.gmane.org>
2012-06-26 23:00   ` Masanari Iida
2012-06-26 23:00     ` Masanari Iida
2012-06-27 18:29   ` tj-DgEjT+Ai2ygdnm+yROfE0A
2012-06-27 18:29     ` tj
     [not found]     ` <20120627182903.GP15811-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-06-27 23:02       ` tj-DgEjT+Ai2ygdnm+yROfE0A
2012-06-27 23:02         ` tj
     [not found]         ` <20120627230230.GT15811-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-06-28 14:09           ` Masanari Iida
2012-06-28 14:09             ` Masanari Iida
2012-06-28  6:07     ` Li Zefan
2012-06-28  6:07     ` Li Zefan
     [not found]       ` <4FEBF4B7.2070105-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2012-06-28 18:07         ` tj-DgEjT+Ai2ygdnm+yROfE0A
2012-06-28 18:07           ` tj
     [not found]           ` <20120628180712.GC22641-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-06-29  2:20             ` Li Zefan
2012-06-29  2:20               ` Li Zefan
     [not found]               ` <4FED10DB.7040500-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2012-06-29 16:58                 ` tj-DgEjT+Ai2ygdnm+yROfE0A
2012-06-29 16:58                   ` tj
2012-06-29 18:07                   ` Masanari Iida
     [not found]                   ` <20120629165809.GB21048-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-06-30  6:13                     ` Li Zefan
2012-06-30  6:13                       ` Li Zefan
     [not found]                       ` <4FEE98EE.1050409-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2012-06-30  6:47                         ` Al Viro
2012-06-30  6:47                           ` Al Viro
     [not found]                           ` <20120630064724.GC14083-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
2012-06-30  7:04                             ` Tejun Heo
2012-06-30  7:04                               ` Tejun Heo
     [not found]                               ` <CAOS58YNnU3J+c2ZQcRCesSoxn0dSJjDLBsZ2qzZ09X6N-ky0fQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-06-30  8:34                                 ` Al Viro
2012-06-30  8:34                                   ` Al Viro
     [not found]                                   ` <20120630083421.GD14083-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
2012-07-03 17:10                                     ` Tejun Heo
2012-07-03 17:10                                       ` Tejun Heo
     [not found]                                       ` <20120703171033.GC555-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-07-03 17:38                                         ` Tejun Heo [this message]
2012-07-03 17:38                                           ` [PATCH] cgroup: cgroup_rm_files() was calling simple_unlink() with the wrong inode Tejun Heo
     [not found]                                           ` <20120703173806.GD555-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-07-04  5:40                                             ` Li Zefan
2012-07-04  5:40                                               ` Li Zefan
     [not found]                                               ` <4FF3D757.9060905-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2012-07-09 17:11                                                 ` Tejun Heo
2012-07-09 17:11                                                   ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120703173806.GD555@google.com \
    --to=tj-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
    --cc=sanil.kumar-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
    --cc=shyju.pv-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
    --cc=standby24x7-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=viro-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.