From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tejun Heo Subject: Re: 3.5-rc3: BUG: Dentry still in use (1) [unmount of cgroup cgroup] Date: Tue, 3 Jul 2012 10:10:33 -0700 Message-ID: <20120703171033.GC555@google.com> References: <20120627182903.GP15811@google.com> <4FEBF4B7.2070105@huawei.com> <20120628180712.GC22641@google.com> <4FED10DB.7040500@huawei.com> <20120629165809.GB21048@google.com> <4FEE98EE.1050409@huawei.com> <20120630064724.GC14083@ZenIV.linux.org.uk> <20120630083421.GD14083@ZenIV.linux.org.uk> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=CLMyt3Ivv8l6zL6jwwO9hhGkhqo6nIYHW32oxo59XVY=; b=n2WmdPgEQeIlThEBU1GS34ZPmwiwPEzKpwCxkYrR2vDSCtFvEsJ/SLCKXeQTKa3FOP zIv6oHklOkmsi/Ll/NGxUq0dyFYxD4En9nMRcUDzoR3G6mLBegl1O3ruXhRr1vQYhJzL Q4sP/ZFI8qV56xyb0jYOF2Z63R2uW2Ph82qfupFCldESIf10qebCfMnjNSzwyeZBfm3Y MMdG/D5RhinRyGJqbV630fUKIATMMq0s+NNW1olhY8lbQqxIquQ9VMc3dbGGyqpi26hf BqwMIuGQ9jy2FzKhQWJNkG5m4LEcvqerhq3kK0DZR75vbLwFqEQSojzMXuAmWR84XeuX Rpzw== Content-Disposition: inline In-Reply-To: <20120630083421.GD14083-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Al Viro Cc: Li Zefan , shyju pv , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Sanil kumar , Masanari Iida Hello, Al. On Sat, Jun 30, 2012 at 09:34:21AM +0100, Al Viro wrote: > Now that I've looked at that code again... What's the story with > simple_unlink(d->d_inode, d); > in cgroup_rm_file()? Wrong parent inode, at the very least... Yeah, indeed. My mistake while refactoring the code. Will fix. > While we are at it, what the hell is going on in > static void cgroup_clear_directory(struct dentry *dir) > { > struct cgroup *cgrp = __d_cgrp(dir); > > while (!list_empty(&cgrp->files)) > cgroup_rm_file(cgrp, NULL); > } > Are you fighting some kind of race against somebody adding stuff > there? Unless I'm seriously misreading cgroup_rm_file(), it'll > do all the work on the first call... cgroup_rm_file() finds the file matching @cft, deletes that one file and returns. Passing in %NULL @cft makes it deletes the first file but it still returns after deleting one. Maybe breaking up list_for_each_entry() so that deletion and returning is outside the loop would make that clearer. Thanks. -- tejun From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757015Ab2GCRKk (ORCPT ); Tue, 3 Jul 2012 13:10:40 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:35609 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752181Ab2GCRKi (ORCPT ); Tue, 3 Jul 2012 13:10:38 -0400 Date: Tue, 3 Jul 2012 10:10:33 -0700 From: Tejun Heo To: Al Viro Cc: Li Zefan , shyju pv , "linux-kernel@vger.kernel.org" , "cgroups@vger.kernel.org" , Sanil kumar , Masanari Iida Subject: Re: 3.5-rc3: BUG: Dentry still in use (1) [unmount of cgroup cgroup] Message-ID: <20120703171033.GC555@google.com> References: <20120627182903.GP15811@google.com> <4FEBF4B7.2070105@huawei.com> <20120628180712.GC22641@google.com> <4FED10DB.7040500@huawei.com> <20120629165809.GB21048@google.com> <4FEE98EE.1050409@huawei.com> <20120630064724.GC14083@ZenIV.linux.org.uk> <20120630083421.GD14083@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120630083421.GD14083@ZenIV.linux.org.uk> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Al. On Sat, Jun 30, 2012 at 09:34:21AM +0100, Al Viro wrote: > Now that I've looked at that code again... What's the story with > simple_unlink(d->d_inode, d); > in cgroup_rm_file()? Wrong parent inode, at the very least... Yeah, indeed. My mistake while refactoring the code. Will fix. > While we are at it, what the hell is going on in > static void cgroup_clear_directory(struct dentry *dir) > { > struct cgroup *cgrp = __d_cgrp(dir); > > while (!list_empty(&cgrp->files)) > cgroup_rm_file(cgrp, NULL); > } > Are you fighting some kind of race against somebody adding stuff > there? Unless I'm seriously misreading cgroup_rm_file(), it'll > do all the work on the first call... cgroup_rm_file() finds the file matching @cft, deletes that one file and returns. Passing in %NULL @cft makes it deletes the first file but it still returns after deleting one. Maybe breaking up list_for_each_entry() so that deletion and returning is outside the loop would make that clearer. Thanks. -- tejun