From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27768C433EF for ; Sun, 5 Sep 2021 14:50:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 060D460FE6 for ; Sun, 5 Sep 2021 14:50:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231657AbhIEOvY (ORCPT ); Sun, 5 Sep 2021 10:51:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:58166 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229566AbhIEOvY (ORCPT ); Sun, 5 Sep 2021 10:51:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8CB7C60F56; Sun, 5 Sep 2021 14:50:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1630853421; bh=FEybAdpiS1hYOWHcM3Dkw6cVjxzDuK4bSKXHV9lUvaw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hcGVOh3nMJHiUEshvDtZJsPLJrBzWG5p5xRG6xF2GrWvyan5lyGlqmhAbxTk6DRsp wp112C5lP5xLC7azpHggtIdbLNtoxUVsi2407nx9zMWheFCuETuMNdE6Dz4H2VONU1 m+fakYmOK0kAdp/Tdh25eHSWcr0bzaoAElv1C14s= Date: Sun, 5 Sep 2021 16:50:18 +0200 From: Greg KH To: Ian Pilcher Cc: axboe@kernel.dk, pavel@ucw.cz, linux-leds@vger.kernel.org, linux-block@vger.kernel.org, linux@vger.kernel.org, kabel@kernel.org Subject: Re: [PATCH 17/18] ledtrig-blkdev: Add mode (read/write/rw) sysfs attributue Message-ID: References: <20210903204548.2745354-1-arequipeno@gmail.com> <20210903204548.2745354-18-arequipeno@gmail.com> 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-block@vger.kernel.org On Sat, Sep 04, 2021 at 04:01:56PM -0500, Ian Pilcher wrote: > On 9/4/21 12:57 AM, Greg KH wrote: > > Also, you are now allowing any user to spam the kernel log, this shold > > be a dev_dbg() call at the most, if it is even needed at all. Same for > > the other pr_info() call in this function, please remove them all. > > Greg - > > A bit of a "philosophical" question, if I may ... > > Is allowing the root user to "spam" the kernel log really a concern? Yes. > (The permissions on the attribute don't allow non-root users to write > to it.) Ah, but that was not obvious :) > As a system administrator working with a sysfs API (or writing udev > rules to do so), I know that I appreciate having a meaningful message in > the log when something doesn't work. That's fine, but do not allow a "normal" user to do so please. > Given that only the root user can trigger these messages, would you be > OK with dev_info()? For a sysfs file failure, use dev_err(). If things are working properly, your kernel code should be totally silent. thanks, greg k-h