[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200328195932.GA96482@google.com>
Date: Sat, 28 Mar 2020 14:59:32 -0500
From: Bjorn Helgaas <helgaas@...nel.org>
To: Kelsey <skunberg.kelsey@...il.com>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-pci@...r.kernel.org,
Kelsey Skunberg <kelsey.skunberg@...il.com>,
rbilovol@...co.com, stable <stable@...r.kernel.org>,
Don Dutile <ddutile@...hat.com>,
Ruslan Bilovol <ruslan.bilovol@...il.com>,
linux-kernel-mentees@...ts.linuxfoundation.org,
Bodong Wang <bodong@...lanox.com>
Subject: Re: [Linux-kernel-mentees] [PATCH v2] PCI: sysfs: Change bus_rescan
and dev_rescan to rescan
On Thu, Mar 26, 2020 at 12:29:11AM -0600, Kelsey wrote:
> On Wed, Mar 25, 2020 at 4:10 PM Bjorn Helgaas <helgaas@...nel.org> wrote:
> > Thanks for taking care of this! Two questions:
> >
> > 1) You supplied permissions of 0220, but DEVICE_ATTR_WO()
> > uses__ATTR_WO(), which uses 0200. Shouldn't we keep 0200?
> >
>
> Good catch. Before changing to DEVICE_ATTR_WO(), the permissions used
> was (S_IWUSR | S_IWGRP), which would be 0220. This means the
> permissions were mistakenly changed from 0220 to 0200 in the same
> patch:
>
> commit 4e2b79436e4f ("PCI: sysfs: Change DEVICE_ATTR() to DEVICE_ATTR_WO()")
>
> To verify DEVICE_ATTR_WO() is using __ATTR_WO() can be seen in
> /include/linux/device.h
> To verify permissions for __ATTR_WO() is 0200 can be seen in
> /inlcude/linux/sysfs.h
>
> These attributes had permissions 0220 when first being introduced and
> before the above mentioned patch, so I'm on the side to believe that
> 0220 should be used.
I'm not sure it was a mistake that 4e2b79436e4f changed from 0220 to
200 or not. I'd say __ATTR_WO (0200) is the "standard" one, and we
should have a special reason to use 0220.
Powered by blists - more mailing lists