mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
To: Bart Van Assche <bvanassche@acm.org>,
	Avri Altman <Avri.Altman@wdc.com>,
	Caleb Connolly <caleb.connolly@linaro.org>,
	"a5b6@riseup.net" <a5b6@riseup.net>,
	Alim Akhtar <alim.akhtar@samsung.com>,
	"James E . J . Bottomley" <jejb@linux.ibm.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "~postmarketos/upstreaming@lists.sr.ht" 
	<~postmarketos/upstreaming@lists.sr.ht>,
	"phone-devel@vger.kernel.org" <phone-devel@vger.kernel.org>
Subject: Re: [RESEND PATCH] scsi: ufs: sysfs: support writing boot_lun attr
Date: Tue, 7 Jun 2022 09:42:21 +0900	[thread overview]
Message-ID: <84bb2d37-4097-5122-7e88-33bd9bc7ed61@opensource.wdc.com> (raw)
In-Reply-To: <2677b02e-b2a3-7c79-2e62-acf1acbc8ff0@acm.org>

On 2022/06/06 22:16, Bart Van Assche wrote:
> On 6/5/22 19:48, Damien Le Moal wrote:
>> On 6/5/22 12:55, Bart Van Assche wrote:
>>> On 6/1/22 10:05, Avri Altman wrote:
>>>> As a design rule, sysfs attribute files should not be used to make
>>>> persistent modifications to a device configuration. This rule applies
>>>> to all subsystems and ufs is no different.
>>>
>>> Hmm ... where does that rule come from? I can't find it in
>>> Documentation/admin-guide/sysfs-rules.rst. Did I perhaps overlook something?
>>
>> I am not aware of any writable sysfs attribute file that can be used to
>> make persistent device configuration changes, at least in storage area.
>> I know of plenty that do change a device setting, but without saving this
>> setting to maintain it across power cycles. Do you know of any such
>> attribute ? I was under the impression that sysfs should not be used to
>> persistently reconfigure a device...
> 
> I don't think the above is sufficient as an argument to reject a new 
> patch that introduces a sysfs attribute that changes the device 
> configuration.

It depends if we can guarantee that the write access to the sysfs file is done
with the same security checks as for a passthrough command issued from user
space. I have not checked.

I would also argue that this particular feature is related to the boot device
management, which is not something we do in the kernel. There is no sysfs
interface to set the bootable flag of a partition on a disk, right ? That is
very similar to me. The kernel should not bother about that kind of interface.
User application tools can deal with that.

> 
> Thanks,
> 
> Bart.
> 


-- 
Damien Le Moal
Western Digital Research

      reply	other threads:[~2022-06-07  0:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-25 16:40 Nia Espera
2022-05-25 18:34 ` Avri Altman
2022-05-26 20:12   ` -
2022-05-27  6:17     ` Avri Altman
2022-05-27 12:50       ` Caleb Connolly
2022-06-01 17:05         ` Avri Altman
2022-06-05  3:55           ` Bart Van Assche
2022-06-06  2:48             ` Damien Le Moal
2022-06-06 13:16               ` Bart Van Assche
2022-06-07  0:42                 ` Damien Le Moal [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=84bb2d37-4097-5122-7e88-33bd9bc7ed61@opensource.wdc.com \
    --to=damien.lemoal@opensource.wdc.com \
    --cc=Avri.Altman@wdc.com \
    --cc=a5b6@riseup.net \
    --cc=alim.akhtar@samsung.com \
    --cc=bvanassche@acm.org \
    --cc=caleb.connolly@linaro.org \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=phone-devel@vger.kernel.org \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®