Thread (19 messages) 19 messages, 5 authors, 2012-07-09

Re: 3.5-rc3: BUG: Dentry still in use (1) [unmount of cgroup cgroup]

From: Li Zefan <hidden>
Date: 2012-06-29 02:20:52
Also in: lkml

On 2012/6/29 2:07, tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org wrote:
Hello, Li.

On Thu, Jun 28, 2012 at 02:07:51PM +0800, Li Zefan wrote:
quoted
quoted
Hmm... fa980ca87d "cgroup: superblock can't be released with active
dentries" is supposed to have fixed that.  Looking into it.

I think I know what happened here:

umount
  deativate_super(sb)
                       dput(subdir)
                         subdir->d_count--
                         d_release(subdir)
                           deactivate_super(sb)
                             shrink_dcache_for_umount(sb)
                               BUG(root->d_count)!!
                         root->d_count--
Can you please elaborate a bit?  I'm not really following?  Where does
the last root->d_count-- come from?

From my limited knowledge about vfs internal, seems the parent's refcnt won't go down
to 0 before its children. When mkdir, the parent's refcnt will be incremented, and
after rmdir, dput(subdir) will drop subdir's refcnt and then drop parent's.

So when dropping the subdir's refcnt and leading the superblock to be killed, the root's
dentry is still > 0.
quoted
I use this script to reproduce the bug:

mount -t cgroup -o cpu xxx /mnt
mkdir /mnt/sub
sleep 100 < /mnt/sub &
kill $!
wait $!
rmdir /mnt/sub
umount /mnt
Unfortunately, this doesn't reproduce the bug here either. :(

I can reproduce the bug reliably.. Try s/cpu/perf or s/cpu/net_cls, which have fewer
cgroup files?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help