All of lore.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Yingjie Wang <x-professor@outlook.com>,
	"axboe@kernel.dk" <axboe@kernel.dk>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH v4 1/4] block: move BLK_DEV_MAX_SECTORS to <linux/blkdev.h>
Date: Wed, 2 Dec 2026 14:51:49 +0900	[thread overview]
Message-ID: <dfaf582d-d7b5-4bb4-a76c-573255132a7c@kernel.org> (raw)
In-Reply-To: <20261201140206.345975-1-x-professor@outlook.com>

On 12/1/26 23:02, Yingjie Wang wrote:
> BLK_DEV_MAX_SECTORS is the largest disk capacity the block layer
> supports: set_capacity() truncates larger capacities and add_disk()
> rejects them. It is defined in block/blk.h, so drivers cannot use it to
> validate a capacity they get from the user before calling
> set_capacity().
> 
> Move it to <linux/blkdev.h>, using SECTOR_SHIFT instead of 9 while at
> it. The next patch uses it in null_blk to reject a configured device
> size that is too large. No functional change.
> 
> Cc: stable@vger.kernel.org # 6.14.x
> Signed-off-by: Yingjie Wang <x-professor@outlook.com>

Reviewed-by: Damien Le Moal <dlemoal@kernel.org>

-- 
Damien Le Moal
Western Digital Research

  reply	other threads:[~2026-12-02  5:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 14:01 [PATCH v4 0/4] null_blk: validate configfs values before power-on Yingjie Wang
2026-12-01 14:02 ` [PATCH v4 1/4] block: move BLK_DEV_MAX_SECTORS to <linux/blkdev.h> Yingjie Wang
2026-12-02  5:51   ` Damien Le Moal [this message]
2026-12-01 14:02 ` [PATCH v4 2/4] null_blk: reject device size overflow Yingjie Wang
2026-12-01 14:02 ` [PATCH v4 3/4] null_blk: reject zone counts that overflow unsigned int Yingjie Wang
2026-12-01 14:02 ` [PATCH v4 4/4] null_blk: validate the configfs home_node attribute Yingjie 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=dfaf582d-d7b5-4bb4-a76c-573255132a7c@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=x-professor@outlook.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 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.