linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Damien Le Moal <Damien.LeMoal@wdc.com>
To: Jens Axboe <axboe@kernel.dk>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>
Cc: Matias Bjorling <Matias.Bjorling@wdc.com>
Subject: Re: [PATCH v3] nullb: Prevent use of legacy request queue mode
Date: Tue, 12 Feb 2019 03:01:56 +0000	[thread overview]
Message-ID: <BN8PR04MB58129B4F85A2007C6C89F6F6E7650@BN8PR04MB5812.namprd04.prod.outlook.com> (raw)
In-Reply-To: a27e13e6-93a3-e7f7-cc67-a7169c8a44ad@kernel.dk

On 2019/02/12 11:55, Jens Axboe wrote:
> On 2/11/19 4:47 PM, Damien Le Moal wrote:
>> When null_blk queue mode is specified together with modprobe/insmod, a
>> check to prevent setting the nullb device queue mode to 1 (NULL_Q_RQ) is
>> done. However, the same check is not performed when setting up a nullb
>> device through configfs, resulting in a oops (NULL pointer dereference
>> for the device request queue).
>>
>> Fix this problem by checking for an invalid queue mode value in
>> null_validate_conf(), propagating -EINVAL to null_add_dev() if the queue
>> mode is NULL_Q_RQ. While at it, also fix the propagation to user space
>> of null_add_dev() return value when a nullb device is created through
>> the power attribute of configfs.
>>
>> Finally, remove the "1=rq" value from the list of possible values of
>> the queue_mode module argument to make it clear that this is no longer
>> a valid setting.
> 
> I actually left that in there on purpose, to avoid breaking test
> scripts. It's not the perfect solution, but I viewed it as the
> lesser of two evils. Maybe we're fine now, I think blktests has
> been fixed a while back?
> 

Yes, blktests is fine right now and not triggering the problem with a default
config. Internally, blktests never tries to enable the rq=1 mode. I discovered
this problem doing tests manually.

-- 
Damien Le Moal
Western Digital Research

      reply	other threads:[~2019-02-12  3:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-11 23:47 [PATCH v3] nullb: Prevent use of legacy request queue mode Damien Le Moal
2019-02-12  2:55 ` Jens Axboe
2019-02-12  3:01   ` Damien Le Moal [this message]

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=BN8PR04MB58129B4F85A2007C6C89F6F6E7650@BN8PR04MB5812.namprd04.prod.outlook.com \
    --to=damien.lemoal@wdc.com \
    --cc=Matias.Bjorling@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.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 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).