Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp365332ybl; Tue, 13 Aug 2019 22:39:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqzQ/q/JqboQTWJq132+ljn3QA0xQGCUyT0SICTvIqr2HFljjF4iyglRxTgdX3tK58qPOoXS X-Received: by 2002:a17:902:6a8b:: with SMTP id n11mr21809616plk.263.1565761181051; Tue, 13 Aug 2019 22:39:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565761181; cv=none; d=google.com; s=arc-20160816; b=e1nNZUyQkX1gZMTE5tF8bCW9JDZXp70UESMBsKtKQbS9KpnCNeAcbJZMju82ahELbN 8CZWV/3RphxOfBSbWCX5HxmMJ9GSxW7P4lya+QZPz+yjSnXW3r8MlZ/O6h6FMPRTmkcA pGNCr67a7hryFotgaeU0hlO4C3MOfQl7+TR6XcCFqNArPd+zrFtVZAWU3XqJXf7jw/mX DHwKyTtbfYYoVVq3gQBbZa/oI+xuhMuWm3o5UHr1gWYisYWz2WV+4y0NFXYKGUs8IJh8 CHCa0RE/YECyEpOLddp+kr4RPso9W0bwdgPHDmuV2ARiuDmuzJYFkJKMItveE7pX32q3 hcUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=qEFFe9qjLWUrmg3Cdtxn6NYYkvMuvcpnD36kabcgEpg=; b=rjz1UD7aX3cLhdpJ82/7/SXGFcKhodRAf2NXfILAdCCG3hi8NnJzmjm9ShcFRjGw7S L8tPN60XYWHW3Cb7ezObWHUTfckTtcKCBAp70NIS8JjVyotarn/rSKuriawTBVGUEkNO Tp4xXvlKdXrwSF9QmKlrdw+1pOooEJ+u+nO9wWPoC4BI1oXzX3s8DwjPtRTMalP/ZPmt laLGUlkA5zaGiuS1KXBfYEFv0breDUKen8eRQCUJ5y5hARhcchZgKeYTK4211CLKTpK2 D5ktwaiW67dYWwG4YSUpczgmMaadFZi0mwgtfiz3Nzi+5Y79R8dzT4dDwEMeUaaONClF pBLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=icdZw5dk; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q9si32615692pgm.409.2019.08.13.22.39.24; Tue, 13 Aug 2019 22:39:41 -0700 (PDT) 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=@kernel.org header.s=default header.b=icdZw5dk; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727435AbfHNFis (ORCPT + 99 others); Wed, 14 Aug 2019 01:38:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:60536 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727095AbfHNFir (ORCPT ); Wed, 14 Aug 2019 01:38:47 -0400 Received: from localhost (c-73-15-1-175.hsd1.ca.comcast.net [73.15.1.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E4F1F20843; Wed, 14 Aug 2019 05:38:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565761127; bh=jbQInFjWCcnVxKfc7U99XY9coODUEn+idyykG/S6etY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=icdZw5dkw+xB/68m0F5VIkcHS3Y562JhnitWRYAyJO34yBtO33gj97J174/RmaIJt dbZ1PZiVsvSgZx/H2yVa7EBKekeVS+XijvnYi8OW65ae/y/vVWE6rTCCwf6SiDlGZe cUqjjXSjXzrDgboNIx2F5lusPtozsD86EjiZ7rIE= Date: Wed, 14 Aug 2019 00:38:46 -0500 From: Bjorn Helgaas To: Kelsey Skunberg Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, Bodong Wang , Donald Dutile , Greg Kroah-Hartman Subject: Re: [Linux-kernel-mentees] [PATCH v2 2/3] PCI: sysfs: Change permissions from symbolic to octal Message-ID: <20190814053846.GA253360@google.com> References: <20190809195721.34237-1-skunberg.kelsey@gmail.com> <20190813204513.4790-1-skunberg.kelsey@gmail.com> <20190813204513.4790-3-skunberg.kelsey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190813204513.4790-3-skunberg.kelsey@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [+cc Bodong, Don, Greg for permission question] On Tue, Aug 13, 2019 at 02:45:12PM -0600, Kelsey Skunberg wrote: > Symbolic permissions such as "(S_IWUSR | S_IWGRP)" are not > preferred and octal permissions should be used instead. Change all > symbolic permissions to octal permissions. > > Example of old: > > "(S_IWUSR | S_IWGRP)" > > Example of new: > > "0220" > static DEVICE_ATTR_RO(sriov_totalvfs); > -static DEVICE_ATTR(sriov_numvfs, (S_IRUGO | S_IWUSR | S_IWGRP), > - sriov_numvfs_show, sriov_numvfs_store); > +static DEVICE_ATTR(sriov_numvfs, 0664, sriov_numvfs_show, sriov_numvfs_store); > static DEVICE_ATTR_RO(sriov_offset); > static DEVICE_ATTR_RO(sriov_stride); > static DEVICE_ATTR_RO(sriov_vf_device); > -static DEVICE_ATTR(sriov_drivers_autoprobe, (S_IRUGO | S_IWUSR | S_IWGRP), > - sriov_drivers_autoprobe_show, sriov_drivers_autoprobe_store); > +static DEVICE_ATTR(sriov_drivers_autoprobe, 0664, sriov_drivers_autoprobe_show, > + sriov_drivers_autoprobe_store); Greg noticed that sriov_numvfs and sriov_drivers_autoprobe have "unusual" permissions. These were added by: 0e7df22401a3 ("PCI: Add sysfs sriov_drivers_autoprobe to control VF driver binding") 1789382a72a5 ("PCI: SRIOV control and status via sysfs") Kelsey's patch correctly preserves the existing permissions, but we should double-check that they are the permissions they want, and possibly add a comment about why they're different from the rest. Bjorn