Linux RAID subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jack Wang" <jinpu.wang@cloud.ionos.com>
Cc: linux-raid@vger.kernel.org, yukuai@fygo.io
Subject: Re: [PATCH v4 1/2] block: suspend bio based disks around queue limits updates
Date: Thu, 12 Nov 2026 14:04:41 +0000	[thread overview]
Message-ID: <sashiko-outbox-211256@kernel.org> (raw)
In-Reply-To: <20261112134700.372702-2-jinpu.wang@cloud.ionos.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] block: missing __releases() annotation on
  blk_disk_commit_limits()
--

commit 191cb84f3b159c80a0741f7887d437ec63eb1187
Author: Jack Wang <jinpu.wang@cloud.ionos.com>

block: suspend bio based disks around queue limits updates

This commit adds optional ->suspend() and ->resume() block_device_operations
callbacks and uses them in queue_attr_store() and flag_store() to suspend the
disk before taking q->limits_lock and commit queue limits without freezing
the queue.

> diff --git a/block/blk.h b/block/blk.h
> index ed21724726223..1c214f0bc1780 100644
> --- a/block/blk.h
> +++ b/block/blk.h
> @@ -661,6 +661,26 @@ void drop_partition(struct block_device *part);
>  
>  void bdev_set_nr_sectors(struct block_device *bdev, sector_t sectors);
>  
> +/* Suspend before queue_limits_start_update(), never under q->limits_lock. */
> +static inline int blk_disk_suspend(struct gendisk *disk)
> +{
> +	return disk->fops->suspend ? disk->fops->suspend(disk) : 0;
> +}
> +
> +static inline void blk_disk_resume(struct gendisk *disk)
> +{
> +	if (disk->fops->suspend)
> +		disk->fops->resume(disk);
> +}
> +
> +static inline int blk_disk_commit_limits(struct gendisk *disk,
> +					 struct queue_limits *lim)
> +{
> +	if (disk->fops->suspend)
> +		return queue_limits_commit_update(disk->queue, lim);
> +	return queue_limits_commit_update_frozen(disk->queue, lim);
> +}

[Severity: Low]
Should blk_disk_commit_limits() have a __releases(&disk->queue->limits_lock)
annotation?

block/Makefile enables CONTEXT_ANALYSIS := y, and both
queue_limits_commit_update() and queue_limits_commit_update_frozen() are
annotated with __releases(&q->limits_lock) to pair with
queue_limits_start_update().  Without the annotation on
blk_disk_commit_limits(), building with Clang and
CONFIG_WARN_CONTEXT_ANALYSIS=y triggers -Wthread-safety warnings in
blk_disk_commit_limits() and its callers flag_store() and queue_attr_store().

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261112134700.372702-1-jinpu.wang@cloud.ionos.com?part=1

  reply	other threads:[~2026-11-12 14:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12 13:46 [PATCH v4 0/2] block, md: suspend md around queue limits updates Jack Wang
2026-11-12 13:46 ` [PATCH v4 1/2] block: suspend bio based disks " Jack Wang
2026-11-12 14:04   ` sashiko-bot [this message]
2026-11-12 13:47 ` [PATCH v4 2/2] md: suspend the array instead of freezing the queue for " Jack Wang

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=sashiko-outbox-211256@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=jinpu.wang@cloud.ionos.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=yukuai@fygo.io \
    /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