From: kbusch@kernel.org (Keith Busch)
Subject: [PATCH] nvmet-file: clamp-down file namespace lba_shift
Date: Wed, 6 Mar 2019 13:49:58 -0700 [thread overview]
Message-ID: <20190306204958.GA1603@localhost.localdomain> (raw)
In-Reply-To: <SN6PR04MB4527804E0DF20A373E42BC2986730@SN6PR04MB4527.namprd04.prod.outlook.com>
On Wed, Mar 06, 2019@08:38:21PM +0000, Chaitanya Kulkarni wrote:
> On 3/6/19 12:19 PM, Sagi Grimberg wrote:
> > Quick look shows that this is coming from blk_queue_stack_limits for the
> > ns_head.
> >
> > Looks like nvme_update_disk_info() is reading a bs=0:
> > --
> > unsigned short bs = 1 << ns->lba_shift;
> > --
> >
> > bs is 16 bits and lba_shift is 20
> > (coming directly from the tempfile file_inode(ns->file)->i_blkbits)
> >
> > So this fixes that one as well. Regardless, I think bs should be
> > unsigned int?
>
> Yes.
blk_queue_logical_block_size() takes an 'unsigned short', so be sure to
check 'bs' is less than USHRT_MAX.
next prev parent reply other threads:[~2019-03-06 20:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-05 9:55 [PATCH] nvmet-file: clamp-down file namespace lba_shift Sagi Grimberg
2019-03-06 20:11 ` Chaitanya Kulkarni
2019-03-06 20:19 ` Sagi Grimberg
2019-03-06 20:38 ` Chaitanya Kulkarni
2019-03-06 20:49 ` Keith Busch [this message]
2019-03-07 1:14 ` Sagi Grimberg
2019-03-08 13:30 ` 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=20190306204958.GA1603@localhost.localdomain \
--to=kbusch@kernel.org \
/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.