Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756604AbbLWQge (ORCPT ); Wed, 23 Dec 2015 11:36:34 -0500 Received: from h2.hallyn.com ([78.46.35.8]:36218 "EHLO h2.hallyn.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751075AbbLWQgc (ORCPT ); Wed, 23 Dec 2015 11:36:32 -0500 Date: Wed, 23 Dec 2015 10:36:30 -0600 From: "Serge E. Hallyn" To: Tejun Heo Cc: serge.hallyn@ubuntu.com, linux-api@vger.kernel.org, containers@lists.linux-foundation.org, hannes@cmpxchg.org, linux-kernel@vger.kernel.org, ebiederm@xmission.com, lxc-devel@lists.linuxcontainers.org, gregkh@linuxfoundation.org, cgroups@vger.kernel.org, akpm@linux-foundation.org Subject: Re: [PATCH 1/8] kernfs: Add API to generate relative kernfs path Message-ID: <20151223163630.GA19488@mail.hallyn.com> References: <1450844609-9194-1-git-send-email-serge.hallyn@ubuntu.com> <1450844609-9194-2-git-send-email-serge.hallyn@ubuntu.com> <20151223160854.GF5003@mtj.duckdns.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151223160854.GF5003@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: 1417 Lines: 44 On Wed, Dec 23, 2015 at 11:08:54AM -0500, Tejun Heo wrote: > Hello, Serge. > > On Tue, Dec 22, 2015 at 10:23:22PM -0600, serge.hallyn@ubuntu.com wrote: > > @@ -164,18 +286,39 @@ void pr_cont_kernfs_name(struct kernfs_node *kn) > > void pr_cont_kernfs_path(struct kernfs_node *kn) > > { > > unsigned long flags; > > - char *p; > > + char *p = NULL; > > + int sz1, sz2; > > > > spin_lock_irqsave(&kernfs_rename_lock, flags); > > > > - p = kernfs_path_locked(kn, kernfs_pr_cont_buf, > > - sizeof(kernfs_pr_cont_buf)); > > - if (p) > > - pr_cont("%s", p); > > - else > > - pr_cont(""); > > + sz1 = kernfs_path_from_node_locked(kn, NULL, kernfs_pr_cont_buf, > > + sizeof(kernfs_pr_cont_buf)); > > + if (sz1 < 0) { > > + pr_cont("(error)"); > > + goto out; > > + } > > + > > + if (sz1 < sizeof(kernfs_pr_cont_buf)) { > > + pr_cont("%s", kernfs_pr_cont_buf); > > + goto out; > > + } > > + > > + p = kmalloc(sz1 + 1, GFP_NOFS); > > We can't do GFP_NOFS allocation while holding a spinlock and we don't > want to do atomic allocation here either. I think it'd be best to > keep using the static buffer. D'oh, right. Will update. -- 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/