]> git.baikalelectronics.ru Git - kernel.git/commit
block: fix unintended fallthrough in generic_make_request_checks()
authorNicolai Stange <nicstange@gmail.com>
Sun, 4 Dec 2016 13:56:39 +0000 (14:56 +0100)
committerJens Axboe <axboe@fb.com>
Mon, 5 Dec 2016 14:54:39 +0000 (07:54 -0700)
commit7112779832a48f8245c8efc87e075c46d2d0d9a1
tree89095602dbb2203899f9e32659c145308bba0608
parentc0127496a5a3cfe53a85b8410981f1bba3c81ae4
block: fix unintended fallthrough in generic_make_request_checks()

Since commit 133b841473f4 ("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 5af1f5ccaf21 ("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 133b841473f4 ("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: 133b841473f4 ("block: add async variant of blkdev_issue_zeroout")
Fixes: 5af1f5ccaf21 ("block: Define zoned block device operations")
Signed-off-by: Nicolai Stange <nicstange@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-core.c