Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756241AbbLGPxJ (ORCPT ); Mon, 7 Dec 2015 10:53:09 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:51166 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755472AbbLGPxG (ORCPT ); Mon, 7 Dec 2015 10:53:06 -0500 Date: Mon, 7 Dec 2015 15:53:01 +0000 From: Serge Hallyn To: Tejun Heo Cc: serge@hallyn.com, linux-kernel@vger.kernel.org, adityakali@google.com, linux-api@vger.kernel.org, containers@lists.linux-foundation.org, cgroups@vger.kernel.org, lxc-devel@lists.linuxcontainers.org, akpm@linux-foundation.org, ebiederm@xmission.com Subject: Re: [PATCH 7/8] cgroup: mount cgroupns-root when inside non-init cgroupns Message-ID: <20151207155301.GD10746@ubuntumail> References: <20151201040704.GA31067@mail.hallyn.com> <20151201164649.GD12922@mtj.duckdns.org> <20151201215853.GA9153@mail.hallyn.com> <20151202165312.GB19878@mtj.duckdns.org> <20151202165637.GA20840@mail.hallyn.com> <20151202165839.GD19878@mtj.duckdns.org> <20151202170239.GA21009@mail.hallyn.com> <20151202170551.GE19878@mtj.duckdns.org> <20151203224706.GA19971@mail.hallyn.com> <20151207153911.GF9175@mtj.duckdns.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151207153911.GF9175@mtj.duckdns.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1446 Lines: 53 Quoting Tejun Heo (tj@kernel.org): > Hello, Serge. > > On Thu, Dec 03, 2015 at 04:47:06PM -0600, Serge E. Hallyn wrote: > ... > > + dentry = dget(sb->s_root); > > + if (!kn->parent) // this is the root > > + return dentry; > > + > > + knparent = find_kn_ancestor_below(kn, NULL); > > + BUG_ON(!knparent); > > Doing WARN_ON() and returning failure is better, I think. Failing ns > mount is an okay failure mode and a lot better than crashing the > system. Ok - this shouldn't be user-triggerable, so if it happens it really is a bug in our code, but I'll change it, > Also, how about find_next_ancestor() for the name of the > function? Yeah it's static anyway :) will change, squash, and resend the set. > > + do { > > + struct dentry *dtmp; > > + struct kernfs_node *kntmp; > > + > > + if (kn == knparent) > > + return dentry; > > + kntmp = find_kn_ancestor_below(kn, knparent); > > + BUG_ON(!kntmp); > > + dtmp = lookup_one_len(kntmp->name, dentry, strlen(kntmp->name)); > > + dput(dentry); > > + if (IS_ERR(dtmp)) > > + return dtmp; > > + knparent = kntmp; > > + dentry = dtmp; > > + } while (1); > > Other than the nitpicks, looks good to me. > > Thanks. > > -- > tejun -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/