From: Stefan Haberland <sth@linux.ibm.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Jens Axboe <axboe@kernel.dk>, Ilya Dryomov <idryomov@gmail.com>,
Song Liu <song@kernel.org>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
Jan Hoeppner <hoeppner@linux.ibm.com>,
linux-block@vger.kernel.org, ceph-devel@vger.kernel.org,
linux-bcache@vger.kernel.org, linux-raid@vger.kernel.org,
linux-mtd@lists.infradead.org, linux-s390@vger.kernel.org
Subject: Re: [PATCH 06/10] dasd: implement ->set_read_only to hook into BLKROSET processing
Date: Fri, 6 Nov 2020 17:08:58 +0100 [thread overview]
Message-ID: <20201106160858.GA76682@imap.linux.ibm.com> (raw)
In-Reply-To: <20201106140201.GA23087@lst.de>
Christoph Hellwig <hch@lst.de> schrieb am Fri, 06. Nov 15:02:
> On Thu, Nov 05, 2020 at 09:56:47PM +0100, Stefan Haberland wrote:
> > > + /* do not manipulate hardware state for partitions */
> > > if (bdev_is_partition(bdev))
> > > - // ro setting is not allowed for partitions
> > > - return -EINVAL;
> > > - if (get_user(intval, (int __user *)argp))
> > > - return -EFAULT;
> > > + return 0;
> > > +
> > > base = dasd_device_from_gendisk(bdev->bd_disk);
> > > if (!base)
> > > return -ENODEV;
> > > - if (!intval && test_bit(DASD_FLAG_DEVICE_RO, &base->flags)) {
> > > - dasd_put_device(base);
> > > - return -EROFS;
> > > - }
> > > - set_disk_ro(bdev->bd_disk, intval);
> >
> >
> > While testing this patch I just noticed that when I set a device readonly this is
> > not going to be passed on to the partitions on this device any longer.
> >
> > This is caused by the removed call to set_disk_ro().
> >
> > Is this intentional or was this removed by accident?
>
> It was unintentionally intentional :)
>
> The generic code used already by almost all drivers in mainline only
> calls set_device_ro from blkdev_roset, that is it only sets the main
> device read-only. dasd was the outlier here, and I didn't notice it
> actually called set_disk_ro instead of set_device_ro. That being
> said I think setting all the partitions read-only as well when the
> full device is set read-only makes perfect sense. I'm just a little
> worried it could cause regressions. Let me prepare a follow on patch
> on top of the series that switches to that behavior.
Makes sense.
I am fine with that.
With this in mind:
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
next prev parent reply other threads:[~2020-11-06 16:09 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-03 10:00 block ioctl cleanups v2 Christoph Hellwig
2020-11-03 10:00 ` [PATCH 01/10] mtd_blkdevs: don't override BLKFLSBUF Christoph Hellwig
2020-11-03 10:00 ` [PATCH 02/10] block: don't call into the driver for BLKFLSBUF Christoph Hellwig
2020-11-03 10:00 ` [PATCH 03/10] block: add a new set_read_only method Christoph Hellwig
2020-11-03 10:00 ` [PATCH 04/10] rbd: implement ->set_read_only to hook into BLKROSET processing Christoph Hellwig
2020-11-03 10:00 ` [PATCH 05/10] md: " Christoph Hellwig
2020-11-06 0:59 ` Song Liu
2020-11-03 10:00 ` [PATCH 06/10] dasd: " Christoph Hellwig
2020-11-05 20:56 ` Stefan Haberland
2020-11-06 14:02 ` Christoph Hellwig
2020-11-06 16:08 ` Stefan Haberland [this message]
2020-11-03 10:00 ` [PATCH 07/10] block: don't call into the driver for BLKROSET Christoph Hellwig
2020-11-03 10:00 ` [PATCH 08/10] loop: use set_disk_ro Christoph Hellwig
2020-11-03 10:00 ` [PATCH 09/10] block: remove set_device_ro Christoph Hellwig
2020-11-03 10:00 ` [PATCH 10/10] block: remove __blkdev_driver_ioctl Christoph Hellwig
2020-11-11 7:58 ` block ioctl cleanups v2 Christoph Hellwig
2020-11-11 16:13 ` Jens Axboe
2020-11-11 16:20 ` Christoph Hellwig
2020-11-11 16:23 ` Jens Axboe
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=20201106160858.GA76682@imap.linux.ibm.com \
--to=sth@linux.ibm.com \
--cc=axboe@kernel.dk \
--cc=ceph-devel@vger.kernel.org \
--cc=hch@lst.de \
--cc=hoeppner@linux.ibm.com \
--cc=idryomov@gmail.com \
--cc=linux-bcache@vger.kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linux-raid@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=song@kernel.org \
--cc=vigneshr@ti.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).