Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1295407pxf; Fri, 26 Mar 2021 05:21:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwip10+JGgMYSYexSOWWJRbLbW5UQdlG1WXRWMFuXRCCGGtQa6NZXddhB8Iijoe1eKIptZt X-Received: by 2002:a17:907:1b06:: with SMTP id mp6mr4491919ejc.292.1616761288961; Fri, 26 Mar 2021 05:21:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616761288; cv=none; d=google.com; s=arc-20160816; b=HUoGYrkdKIvi2jngyVaE++AAc+ju954uQx6qaMul8cNKggrHs7xcZSAXxM5YvdzTj0 0dNCZ5pz+7a45sBIU4pppYxkAMQBVWIHTBxAin2w0HxXct9vzpZa/f4M+LcJorvY/oCI nSV8TllwXdaTnHpmIABtbdPzAridvsOqFcZPaHTVzh2sUyin/lUQ/amiotKb/3sAuqo+ GvnoJQYSc5Q35AHq3VnoZgWad26LtBs2H/0qIj7psFRk/u5bK4ZUH5gvrijH8BcwWqj+ 8miXqwDQsr3VjYi3PM67RGxV3q0ezGjpBcTkKllIoFG0iblzs5uslk8K7dohHdmb86N1 QW7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=n0UTYeQ8155r2slk6QROPnwDYNXcvxJOfkGm+GeyIgE=; b=q5oHS3eCy46HhtihNAnQ9MHC75pX06Y60bZtROsxlI+X0xpBnrggx3WHcQtP874Dar QuLeLR/xpwHnh8QF1T4LJIF8/5AiuF+ynm3c9SHD/7fzXxf0BB3pyXu8PBlOKFEUqGqV bLaaIvRpIztr6XuqVbVOzZqrmFmH3pbiofCOhzOYekkFUFrVNuaC9hbKr2/WI1+2Roc8 3oaK1g17jUrE616y+qRtnOFlG0m9rUeW5gZSjk5X1nkYPhXNbc3Rd0lZwl41oGxnIRzV scDP02QioZGodrfRn3eY4gJ85B7PcUmL564L6fTwpEbAX9C4mzEd4Qoh80go1Hnx+oIt igEQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bs6si6488664edb.145.2021.03.26.05.21.04; Fri, 26 Mar 2021 05:21:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229882AbhCZMTT (ORCPT + 99 others); Fri, 26 Mar 2021 08:19:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:50750 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229866AbhCZMSz (ORCPT ); Fri, 26 Mar 2021 08:18:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CF42C61879; Fri, 26 Mar 2021 12:18:54 +0000 (UTC) Date: Fri, 26 Mar 2021 13:18:52 +0100 From: Greg KH To: Peter Zijlstra Cc: mingo@kernel.org, mgorman@suse.de, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, bristot@redhat.com, joshdon@google.com, valentin.schneider@arm.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 6/9] debugfs: Implement debugfs_create_str() Message-ID: References: <20210326103352.603456266@infradead.org> <20210326103935.183934395@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 26, 2021 at 12:38:39PM +0100, Peter Zijlstra wrote: > On Fri, Mar 26, 2021 at 12:30:24PM +0100, Greg KH wrote: > > Great, change that and limit the size of the string that can be written > > and it looks good to me, thanks for adding this. > > Here goes.. Great, except one tiny thing: > + * This function will return a pointer to a dentry if it succeeds. This > + * pointer must be passed to the debugfs_remove() function when the file is > + * to be removed (no automatic cleanup happens if your module is unloaded, > + * you are responsible here.) If an error occurs, ERR_PTR(-ERROR) will be > + * returned. > + * > + * NOTE: when writing is enabled it will replace the string, string lifetime is > + * assumed to be RCU managed. > + * > + * If debugfs is not enabled in the kernel, the value ERR_PTR(-ENODEV) will > + * be returned. Nothing is returned anymore so the top and bottom paragraphs here no longer apply. Fix that up and feel free to add: Reviewed-by: Greg Kroah-Hartman thanks, greg k-h