Linux block layer
 help / color / mirror / Atom feed
From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Jens Axboe <axboe@kernel.dk>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	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: Sun, 15 Nov 2020 22:55:36 -0500	[thread overview]
Message-ID: <yq1tutq6mbb.fsf@ca-mkp.ca.oracle.com> (raw)
In-Reply-To: <20201113084702.4164912-2-hch@lst.de> (Christoph Hellwig's message of "Fri, 13 Nov 2020 09:47:00 +0100")


Hi Christoph!

> [hch: rebased.  don't mirror the compound read-only flag into a field,

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.

-- 
Martin K. Petersen	Oracle Linux Engineering

  reply	other threads:[~2020-11-16  4:00 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 [this message]
2020-11-16 17:37     ` Christoph Hellwig
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=yq1tutq6mbb.fsf@ca-mkp.ca.oracle.com \
    --to=martin.petersen@oracle.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox