From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Tyler Erickson <tyler.erickson@seagate.com>,
jejb@linux.ibm.com, martin.petersen@oracle.com,
linux-scsi@vger.kernel.org, linux-ide@vger.kernel.org,
muhammad.ahmad@seagate.com
Subject: Re: [PATCH v2 0/3] ata,sd: Fix reading concurrent positioning ranges
Date: Fri, 3 Jun 2022 14:29:40 +0900 [thread overview]
Message-ID: <7fff85a3-b375-2dae-8555-b2d88210f9cc@opensource.wdc.com> (raw)
In-Reply-To: <Ypma2xNMaHYJflNx@infradead.org>
On 6/3/22 14:23, Christoph Hellwig wrote:
> On Fri, Jun 03, 2022 at 10:30:04AM +0900, Damien Le Moal wrote:
>> Looks all good to me. I tested this and really wonder how I did not catch
>> these mistakes earlier :)
>>
>> Using a tcmu emulator for various concurrent positioning range configs to
>> test, I got a lockdep splat when unplugging the drive:
>
> You probably want something like this:
>
> ---
> From 4340b85be3532149310326b5f0caf329e1f4c748 Mon Sep 17 00:00:00 2001
> From: Christoph Hellwig <hch@lst.de>
> Date: Mon, 23 May 2022 09:18:44 +0200
> Subject: block: don't take sysfs_lock in blk_ia_range_sysfs_show
>
> sysfs already synchronizes internally against kobject removal, so remove
> the extra lock.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> block/blk-ia-ranges.c | 8 +-------
> include/linux/blkdev.h | 1 -
> 2 files changed, 1 insertion(+), 8 deletions(-)
>
> diff --git a/block/blk-ia-ranges.c b/block/blk-ia-ranges.c
> index 853be76b9808b..e9e7ebf02737f 100644
> --- a/block/blk-ia-ranges.c
> +++ b/block/blk-ia-ranges.c
> @@ -54,13 +54,8 @@ static ssize_t blk_ia_range_sysfs_show(struct kobject *kobj,
> container_of(attr, struct blk_ia_range_sysfs_entry, attr);
> struct blk_independent_access_range *iar =
> container_of(kobj, struct blk_independent_access_range, kobj);
> - ssize_t ret;
>
> - mutex_lock(&iar->queue->sysfs_lock);
> - ret = entry->show(iar, buf);
> - mutex_unlock(&iar->queue->sysfs_lock);
> -
> - return ret;
> + return entry->show(iar, buf);
I sent a patch that Jens applied doing exactly that. But forgot to add the
removal of the queue pointer you have below. Sending an incremental patch
for that.
> }
>
> static const struct sysfs_ops blk_ia_range_sysfs_ops = {
> @@ -149,7 +144,6 @@ int disk_register_independent_access_ranges(struct gendisk *disk,
> }
>
> for (i = 0; i < iars->nr_ia_ranges; i++) {
> - iars->ia_range[i].queue = q;
> ret = kobject_init_and_add(&iars->ia_range[i].kobj,
> &blk_ia_range_ktype, &iars->kobj,
> "%d", i);
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index a72203ed25454..0ceb85ca52af4 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -348,7 +348,6 @@ static inline int blkdev_zone_mgmt_ioctl(struct block_device *bdev,
> */
> struct blk_independent_access_range {
> struct kobject kobj;
> - struct request_queue *queue;
> sector_t sector;
> sector_t nr_sectors;
> };
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2022-06-03 5:29 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-02 22:51 [PATCH v2 0/3] ata,sd: Fix reading concurrent positioning ranges Tyler Erickson
2022-06-02 22:51 ` [PATCH v2 1/3] libata: fix reading concurrent positioning ranges log Tyler Erickson
2022-06-03 6:17 ` Hannes Reinecke
2022-06-03 7:07 ` Damien Le Moal
2022-06-03 7:42 ` Hannes Reinecke
2022-06-03 8:18 ` Damien Le Moal
2022-06-02 22:51 ` [PATCH v2 2/3] libata: fix translation of concurrent positioning ranges Tyler Erickson
2022-06-03 6:18 ` Hannes Reinecke
2022-06-02 22:51 ` [PATCH v2 3/3] scsi: sd: Fix interpretation of VPD B9h length Tyler Erickson
2022-06-03 1:30 ` Damien Le Moal
2022-06-07 0:44 ` Damien Le Moal
2022-06-03 6:18 ` Hannes Reinecke
2022-06-03 1:30 ` [PATCH v2 0/3] ata,sd: Fix reading concurrent positioning ranges Damien Le Moal
2022-06-03 5:23 ` Christoph Hellwig
2022-06-03 5:29 ` Damien Le Moal [this message]
2022-06-08 2:27 ` Martin K. Petersen
2022-06-08 3:20 ` Damien Le Moal
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=7fff85a3-b375-2dae-8555-b2d88210f9cc@opensource.wdc.com \
--to=damien.lemoal@opensource.wdc.com \
--cc=hch@infradead.org \
--cc=jejb@linux.ibm.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=muhammad.ahmad@seagate.com \
--cc=tyler.erickson@seagate.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