Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp6598466pxb; Wed, 17 Feb 2021 08:28:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJx0j7fgajkthNTN5MLfOhIp9Y84UZyfLwec71JEFXwPJj3HwPUNxeHbh/Ux/eftft1y5x5T X-Received: by 2002:a17:906:4b4c:: with SMTP id j12mr18830778ejv.339.1613579286748; Wed, 17 Feb 2021 08:28:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613579286; cv=none; d=google.com; s=arc-20160816; b=bgIcqPmblBBEgUvEfmc6O0jaWY5lPKdziWQCL5VNaqc10twYttnnxLnLxKhzFwNM8q vRGITuMk4PEznB+c8xG05+TVzN3IOef1cQkWEqTTGWpVzzrM8wSrI6emgXYQ/oAXBciM dOIW8IQUGX0dkxUkUzTw55pNabedCgcicnFW2rXL49vKCLdfPhoei3+N65LD9lIsc8+8 G33zN7Vb94e91Ke9ENU42OyXXA4HM0pgbOZzqRVM7NCGIuqHJjdoNZoDgjVE1k5VUiqN reBiQ220nfSsXXi/WSabyp2K0dmL55dKZ1GFq+h9tTnuxd793LcEZVQqxr5eDDweXuPg Qt0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=ut0i3UNMCZuvoqWdNAPofqX9H/0FtbpaXgUvulT7kdY=; b=pD2ORZeOZGdZtZ9OfFCy07FpxcZLR+FEJbwJFBFyKiOmnIF65F7WGTglYXl8L6ROgQ Jlmrfx8XBd4gzsJZnyLlBsvcEEv1D0Hfv//Ioh2wjJZqC+hm/BLoZBe2QyvSYJ6kZFsn Ru2kx52oQz0+feMhHGN6+i4+jD4duZdw/VgFLbUEMEEBzzZokQSdMbV4KhI8nGSgOYQy 9yGAcr5REeG4TLwEF8swf98pJKc4pTmr5XqpI6cpabuzjUUnKDv5YwDU+/B+1p5c1SJw cS/zBpTi5InfNXZ/79wtr/l3rqygHKqwq3/vwxQv3yAeQNbAhHqp7kpJsWKTE6Gv5H/u HBgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chrisdown.name header.s=google header.b=E0EkzspL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chrisdown.name Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hs7si2240348ejc.128.2021.02.17.08.27.41; Wed, 17 Feb 2021 08:28:06 -0800 (PST) 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; dkim=pass header.i=@chrisdown.name header.s=google header.b=E0EkzspL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chrisdown.name Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234064AbhBQQ0d (ORCPT + 99 others); Wed, 17 Feb 2021 11:26:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233070AbhBQQ0b (ORCPT ); Wed, 17 Feb 2021 11:26:31 -0500 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E696C061574 for ; Wed, 17 Feb 2021 08:25:51 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id n4so15040145wrx.1 for ; Wed, 17 Feb 2021 08:25:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chrisdown.name; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ut0i3UNMCZuvoqWdNAPofqX9H/0FtbpaXgUvulT7kdY=; b=E0EkzspLd5Ur2E3db92QRZU0V0t7WTJUwsm3ZBzUuefl2pAHkLPhHMdliyATroRyc1 FJ+q/8OtaXo5LQ44krV5MAsxSF6/lbkK1qOC6JwTSgIe4lSHUlR6f44zk5h5leg+T8TO EZNYusBkYWNpFbw/86a6Ykypdhh7Zg0+Um8/g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ut0i3UNMCZuvoqWdNAPofqX9H/0FtbpaXgUvulT7kdY=; b=VoYEp3XKCdwge7Jo0nV13jViWm9WikJTVic7Bo39lXiCa+zcAv9n+uXW/Fokavtf1v ssVGhgl8sqqHZtVvKACPuaN/tOIYDXulJTqVr4uiTw1fJL4LG44V7v1/mgmWImfYOaD9 r9+wtEcYfr4hCuMEnssxGo4OdVOSTmkBsb9a42t3xmUg1Tvzh9J+BaIkxS48uuozWj/V PD651KKPonwZ45JrxG2O6KxMv6jboGMeQZqjGq7Uzn3ha1yWRNXsNh2Mock+upVELjBq +WxKLBLQ74uCImzwp3/HUfqrenznnZWhXbHrLmtP1p+tQzKfLkyS03lHN5XiplQLYJXz D6Yw== X-Gm-Message-State: AOAM530nv7zJnbGsv5cj/M4brGM1dmv7QTP84fu5LnI3tqIqHgu+Kf6z uPOOundN9PfAqWsHVl23miFkSg== X-Received: by 2002:a5d:5185:: with SMTP id k5mr53944wrv.352.1613579149779; Wed, 17 Feb 2021 08:25:49 -0800 (PST) Received: from localhost ([2620:10d:c093:400::4:76fd]) by smtp.gmail.com with ESMTPSA id l1sm3584790wmi.48.2021.02.17.08.25.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Feb 2021 08:25:49 -0800 (PST) Date: Wed, 17 Feb 2021 16:25:49 +0000 From: Chris Down To: Petr Mladek Cc: linux-kernel@vger.kernel.org, Sergey Senozhatsky , John Ogness , Johannes Weiner , Andrew Morton , Steven Rostedt , Greg Kroah-Hartman , Kees Cook , kernel-team@fb.com Subject: Re: code style: Re: [PATCH v4] printk: Userspace format enumeration support Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.0.5 (da5e3282) (2021-01-21) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Petr Mladek writes: >What about storing the pointer to struct pf_object into >struct printk_fmt_sec *ps into the s->file->f_inode->i_private? >Then we would not need any global list/table at all. Unless I'm misreading the debugfs code, I think the following is possible: open(f); debugfs_file_get(f); fops->open(); inode->private = ps; debugfs_file_put(f); remove_printk_fmt_sec(); /* kfree ps */ read(f); debugfs_file_get(f); fops->read(); ps = inode->private; /* invalid */ debugfs_file_put(f); That's the reason why the code looks up from the module address again during _read. Maybe I'm missing something? :-) >> Oh, I meant to change the name for v4 but neglected to do so. Sounds good, >> will do. > >Thanks a lot. I am sorry that I ask you to do so many changes. >I talked about the style early enough to make the review easy. >Also I think that it is not ideal and annoing to do these >mass changes and refactoring when the code is already reviewed, >tested, and functional. Quite the opposite: thanks a lot for taking so much time to provide valuable feedback :-) As someone who mostly works on mm code, having you to provide feedback as printk maintainer is really helpful. Even if we disagree on some stuff, it's really important that we have a good shared understanding of what we eventually agree upon.