linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Bottomley <jejb@linux.vnet.ibm.com>
To: "Gurunath, Vasundhara" <vasundhara.gurunath@hpe.com>,
	martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org, paulose.kuriakose.arackal@hpe.com,
	jasminder.kaur@hpe.com
Subject: Re: [PATCH] scsi:Prevent deletion of SCSI block device in use
Date: Tue, 13 Sep 2016 10:17:01 -0700	[thread overview]
Message-ID: <1473787021.2214.45.camel@linux.vnet.ibm.com> (raw)
In-Reply-To: <1473784685-2194-1-git-send-email-vasundhara.gurunath@hpe.com>

On Tue, 2016-09-13 at 22:08 +0530, Gurunath, Vasundhara wrote:
> From: "Gurunath, Vasundhara" <vasundhara.gurunath@hpe.com>
> 
> SCSI block device can be removed, using write to sysfs
> delete file as below:
> echo 1 > /sys/block/sdX/device/delete
> If the device is in use by applications, or part of
> system configuration such as boot device, removal can
> result in application disruptions or system down time.
> 
> An additional write option ? is added to SCSI sysfs
> interface as below, in order to prevent accidental
> deletion of devices in use.
> echo ? > /sys/block/sdX/device/delete
> 
> In the absence of any usage, this option proceeds with
> device deletion.  If the device is open, deletion is
> prevented, and active Open and IO counts at the time of
> deletion is logged. Information logged during latest
> delete attempt can be obtained by issuing a read to the
> delete file as below:
> cat  /sys/block/sdX/device/delete

OK, so I'm not too keen on this because our entire system is (finally)
designed to be hot plug, so echoing 1 to delete simulates a hotplug
event, and they can come in at any time.

Can you elaborate on why this is necessary?  Right at the moment, only
root is allowed to write to this file and cause a deletion ... plus the
file is pretty hard to find, buried as it is in sysfs; So I would have
thought it was pretty safe from accidental misuse; why does it need
additional protection?

James



  reply	other threads:[~2016-09-13 17:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-13 16:38 [PATCH] scsi:Prevent deletion of SCSI block device in use Gurunath, Vasundhara
2016-09-13 17:17 ` James Bottomley [this message]
2016-09-13 18:25 ` Ewan D. Milne
  -- strict thread matches above, loose matches on Subject: below --
2016-09-19  9:11 Gurunath, Vasundhara (STSD)
2016-09-19 12:55 ` James Bottomley
2016-08-19 10:36 Vasundhara Gurunath
2016-08-22 15:36 ` kbuild test robot

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=1473787021.2214.45.camel@linux.vnet.ibm.com \
    --to=jejb@linux.vnet.ibm.com \
    --cc=jasminder.kaur@hpe.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=paulose.kuriakose.arackal@hpe.com \
    --cc=vasundhara.gurunath@hpe.com \
    /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;
as well as URLs for NNTP newsgroup(s).