Received: by 10.223.185.116 with SMTP id b49csp8128853wrg; Thu, 1 Mar 2018 18:09:20 -0800 (PST) X-Google-Smtp-Source: AG47ELsLQ4/DoKRYgK/rE8JRbGjfe79elVqkTW7Swso9gt+mz7+Kr2NjhxE36904+0nvmpcNPTmR X-Received: by 2002:a17:902:710f:: with SMTP id a15-v6mr3671953pll.87.1519956560862; Thu, 01 Mar 2018 18:09:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519956560; cv=none; d=google.com; s=arc-20160816; b=qzeEAqOFvKtMCc5EmuxjdtYTK+H4Va6z5GWPknP1pt8N64mxaCSkqTLn0tEFLoEovX KX7LD6H4lBDin5Ktf2KzY4ecwdUuggXHrq0CbyWEhpmmen/J2g6d3ESFaATZmyxIzlgl PDO+is5YCsEFp4vogqWCz6Vw+rEEsQ2+1LANf23sZDugKTeGlB0H25gTSNArV+IkC1iX dRM2I8OQXY6NZw5Njl3AYZQymyMQyZnTDaMP22hRuzML0FS0+yzA+4huOD51PuIg4W9I g+fMO5xJ3QROa9LqMYnueLG5/27D05+JH0D9541dobVaFcztrUamnihvndMDA9pgQLLd /fGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=Sfri/R5LIzG77Rj2tYX/e+blGfXkQuYdOWEZresF8/c=; b=S2W1V+4y4cJMJ3jyO5UX3MyXyYsJfxQ3DH1OPY7/+XKzwLQjHxsOiFXW7/2ph2liwA 0zIdhGv5VmnVOwLqg3yk6YBMjkUq/5nshMv+JGaVq3mHIyhWVNDIr63bDXBzStAffY8j 60nuWdsV4O+VnuE09RxnlKA1cAn0x/LsAaQiTMdg3eNeSXn4TkCjQ7JpEp/HvXGHVzj4 BQBrEBnM0f5ondFZRmIZMsagBAy7cbO7K/qsCceIEJXESeaCsqSjhgM8+ZpBAD1HD8ij j39dguc0jiefvwalwCSn9zoRppa6ztY6/YalqotSmLXymR4G9C9OywurRLPH/W0kdY9Y +u3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=iOA74tkb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u3-v6si3975873plb.72.2018.03.01.18.09.05; Thu, 01 Mar 2018 18:09:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=iOA74tkb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1163659AbeCBAgQ (ORCPT + 99 others); Thu, 1 Mar 2018 19:36:16 -0500 Received: from mail-ot0-f196.google.com ([74.125.82.196]:39550 "EHLO mail-ot0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163343AbeCBAgN (ORCPT ); Thu, 1 Mar 2018 19:36:13 -0500 Received: by mail-ot0-f196.google.com with SMTP id h8so7342099oti.6 for ; Thu, 01 Mar 2018 16:36:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Sfri/R5LIzG77Rj2tYX/e+blGfXkQuYdOWEZresF8/c=; b=iOA74tkbe1rfykd3k3JrfxmDfrlNM+7du4Jv+OI3iiMo09tZJ4p5C4GHJQtUOYhyCu 8Q/o689U82p4ZhzDv6sb/XViQjL2a9KI9WWgv6bE4DFcMaCb5kIrc1YhyZLguUU9agDh JpPCvZiZg6lDCcRm6R/jFLNkbP8PiYRuIlVt1Z6z/P2xZEmFekcUz4RSjl9nj0XuebK7 Ml4qeiK6/sEQcg2c/mOhbEvpsGcZNKM3OKmXghl/BJGyLHhORyWlHiibSYdG1dfg021j Am3xDOLuQ25zC7xWAfIkV4x1FeY5hnUoPBPOYKGQWaswMnAth6c6pqsIuktXcek8WSy6 lyOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Sfri/R5LIzG77Rj2tYX/e+blGfXkQuYdOWEZresF8/c=; b=Ao+D1oQ/ZzpAlE7eXDr9dKCqrBorzB6jsA9C/AJgc05PM7ZYmb+kLJbw6qzcKhrICI pleo4pesDEWjI8Y3HCHypepo2BO0cm9B1uyijecyO4sVhhD/AWr75oq47+52ofevovwk mCb/QwSx+U/JeytjKb0PsVXSmJocUJBRjmGl7ljLEUG6U9/y78VZaInyJQOFCkShewF8 mIfoNwN/w7ujmkeY7PuuD2UHDlc/uxcAoanoAfLPMzsdWcVrUZ77y9PwiEzgSKAykFlO yg+YwcepuNia0Qat7t7/VZ1KMuCUqU3e04iNJGsCOyc4wwuVy4YmDQSTXw7uT53AtIgP nrFA== X-Gm-Message-State: AElRT7G1XRGOsmFI5PGn7BZXQc4GNNc6Ef3hGPI1uqDNbfuHKEr2+qBK AvVGpBjBMxF8B9rbzQ0R8iATTcHHATABtlqqSk11nCJc X-Received: by 10.157.61.99 with SMTP id a90mr2411630otc.35.1519950972885; Thu, 01 Mar 2018 16:36:12 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.81.210 with HTTP; Thu, 1 Mar 2018 16:36:12 -0800 (PST) In-Reply-To: References: <20180228234006.21093-1-logang@deltatee.com> <20180228234006.21093-3-logang@deltatee.com> <20180301174450.GF13722@bhelgaas-glaptop.roam.corp.google.com> From: Dan Williams Date: Thu, 1 Mar 2018 16:36:12 -0800 Message-ID: Subject: Re: [PATCH v2 02/10] PCI/P2PDMA: Add sysfs group to display p2pmem stats To: Logan Gunthorpe Cc: Bjorn Helgaas , Linux Kernel Mailing List , linux-pci@vger.kernel.org, linux-nvme@lists.infradead.org, linux-rdma , linux-nvdimm , linux-block@vger.kernel.org, Stephen Bates , Christoph Hellwig , Jens Axboe , Keith Busch , Sagi Grimberg , Bjorn Helgaas , Jason Gunthorpe , Max Gurtovoy , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Benjamin Herrenschmidt , Alex Williamson Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 1, 2018 at 4:15 PM, Logan Gunthorpe wrote: > > > On 01/03/18 10:44 AM, Bjorn Helgaas wrote: >> >> I think these two statements are out of order, since the attributes >> dereference pdev->p2pdma. And it looks like you set "error" >> unnecessarily, since you return immediately looking at it. > > > Per the previous series, sysfs_create_group is must_check for some reason. I > had a printk there but you didn't think it was necessary. So assigning it to > error is the only way to squash the warning. Why not fail the setup if the sysfs_create_group() fails? Sure, it may not be strictly required for userspace to have access to these attributes, but it seems hostile that userspace can't make assumptions about the presence of the "p2pmem" directory relative to the capability being setup.