All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>,
	Oleksii Kurochko <olkuroch@cisco.com>,
	Sagi Grimberg <sagi@grimberg.me>,
	linux-block@vger.kernel.org
Subject: Re: [PATCH 1/3] block: Fix read-only block device setting after revalidate
Date: Mon, 16 Nov 2020 18:37:19 +0100	[thread overview]
Message-ID: <20201116173719.GB24173@lst.de> (raw)
In-Reply-To: <yq1tutq6mbb.fsf@ca-mkp.ca.oracle.com>

On Sun, Nov 15, 2020 at 10:55:36PM -0500, Martin K. Petersen wrote:
> My original patch separated "should-write-bios-be-rejected?" state from
> "did-the-user-set-this-partition-ro?". In the rebased version a
> full-device state transition in update_all_part_ro_state() blows away
> any policy the user has set on a given partition.
> 
> The blktests that fail are due to something like:
> 
> # modprobe scsi_debug num_parts=2
> # blockdev --setro /dev/sda2
> # grep . /sys/block/sda/sda2/ro
> 1
> # echo 1 > /sys/module/scsi_debug/parameters/wp
> # echo 1 > /sys/block/sda/device/rescan
> # echo 0 > /sys/module/scsi_debug/parameters/wp
> # echo 1 > /sys/block/sda/device/rescan
> # grep . /sys/block/sda/sda2/ro
> 0
> 
> The user expectation is that since they set partition 2 readonly it
> should remain that way until they either clear the flag or issue
> BLKRRPART to cause the partition table to be reread.

True.  But then again I think the whole idea that a BLKROSET on the
whole device has any effect on the partitions is probably a bad idea.
Even more so once we have the proper hard ro flag in the disk.

I think I'll respin without that.

  reply	other threads:[~2020-11-16 17:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-13  8:46 split hard read-only vs read-only policy Christoph Hellwig
2020-11-13  8:47 ` [PATCH 1/3] block: Fix read-only block device setting after revalidate Christoph Hellwig
2020-11-16  3:55   ` Martin K. Petersen
2020-11-16 17:37     ` Christoph Hellwig [this message]
2020-11-13  8:47 ` [PATCH 2/3] rbd: remove the ->set_read_only methods Christoph Hellwig
2020-11-13  8:47 ` [PATCH 3/3] block: replace hd_struct.make_it_fail with a flag Christoph Hellwig
2020-11-13 18:44 ` split hard read-only vs read-only policy Martin K. Petersen
2020-11-13 19:51 ` Sagi Grimberg
2020-11-14  9:18   ` Christoph Hellwig

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=20201116173719.GB24173@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=olkuroch@cisco.com \
    --cc=sagi@grimberg.me \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.