mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Nicolai Stange <nicstange@gmail.com>
Cc: Chaitanya Kulkarni <chaitanya.kulkarni@hgst.com>,
	Shaun Tancheff <shaun.tancheff@seagate.com>,
	Damien Le Moal <damien.lemoal@hgst.com>,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] block: fix unintended fallthrough in generic_make_request_checks()
Date: Mon, 5 Dec 2016 07:55:09 -0700	[thread overview]
Message-ID: <23525ed3-2a62-7d61-954c-084b891daced@kernel.dk> (raw)
In-Reply-To: <20161204135639.7016-1-nicstange@gmail.com>

On 12/04/2016 06:56 AM, Nicolai Stange wrote:
> Since commit e73c23ff736e ("block: add async variant of
> blkdev_issue_zeroout") messages like the following show up:
> 
>   EXT4-fs (dm-1): Delayed block allocation failed for inode 2368848 at
>                   logical offset 0 with max blocks 1 with error 95
>   EXT4-fs (dm-1): This should not happen!! Data will be lost
> 
> Due to the following fallthrough introduced with
> commit 2d253440b5af ("block: Define zoned block device operations"),
> generic_make_request_checks() would accept a REQ_OP_WRITE_SAME bio only
> if the block device supports "write same" *and* is a zoned one:
> 
>   switch (bio_op(bio)) {
>   [...]
>   case REQ_OP_WRITE_SAME:
>         if (!bdev_write_same(bio->bi_bdev))
>                 goto not_supported;
>   case REQ_OP_ZONE_REPORT:
>   case REQ_OP_ZONE_RESET:
>                 if (!bdev_is_zoned(bio->bi_bdev))
>                         goto not_supported;
>                 break;
>   [...]
>   }
> 
> Thus, although the bio setup as done by __blkdev_issue_write_same() from
> commit e73c23ff736e ("block: add async variant of blkdev_issue_zeroout")
> would succeed, its actual submission would not, resulting in the
> EOPNOTSUPP == 95.
> 
> Fix this by removing the fallthrough which, due to the lack of an explicit
> comment, seems to be unintended anyway.
> 
> Fixes: e73c23ff736e ("block: add async variant of blkdev_issue_zeroout")
> Fixes: 2d253440b5af ("block: Define zoned block device operations")
> Signed-off-by: Nicolai Stange <nicstange@gmail.com>

Added, thanks.

-- 
Jens Axboe

  parent reply	other threads:[~2016-12-05 14:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-04 13:56 Nicolai Stange
2016-12-05 12:37 ` Christoph Hellwig
2016-12-05 14:55 ` Jens Axboe [this message]
2016-12-06  0:04 ` Nicolai Stange

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=23525ed3-2a62-7d61-954c-084b891daced@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=chaitanya.kulkarni@hgst.com \
    --cc=damien.lemoal@hgst.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicstange@gmail.com \
    --cc=shaun.tancheff@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

all inboxes | Powered by JetHome®