tree:
git://git.infradead.org/users/hch/block.git integrity-devirtualize
head: 5221a55f02c9f118f22c061fac410f3b70b26918
commit: 5221a55f02c9f118f22c061fac410f3b70b26918 [30/30] block: devirtualize the integrity
processing
config: x86_64-rhel-8.3-kselftests (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
git remote add hch-block
git://git.infradead.org/users/hch/block.git
git fetch --no-tags hch-block integrity-devirtualize
git checkout 5221a55f02c9f118f22c061fac410f3b70b26918
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
block/blk-core.c: In function 'blk_update_request':
> block/blk-core.c:1423:24: error: 'rq' undeclared (first
use in this function)
1423 | t10_pi_need_remap(rq))
| ^~
block/blk-core.c:1423:24: note: each undeclared identifier is reported only once for
each function it appears in
vim +/rq +1423 block/blk-core.c
1385
1386 /**
1387 * blk_update_request - Special helper function for request stacking drivers
1388 * @req: the request being processed
1389 * @error: block status code
1390 * @nr_bytes: number of bytes to complete @req
1391 *
1392 * Description:
1393 * Ends I/O on a number of bytes attached to @req, but doesn't complete
1394 * the request structure even if @req doesn't have leftover.
1395 * If @req has leftover, sets it up for the next range of segments.
1396 *
1397 * This special helper function is only for request stacking drivers
1398 * (e.g. request-based dm) so that they can handle partial completion.
1399 * Actual device drivers should use blk_mq_end_request instead.
1400 *
1401 * Passing the result of blk_rq_bytes() as @nr_bytes guarantees
1402 * %false return from this function.
1403 *
1404 * Note:
1405 * The RQF_SPECIAL_PAYLOAD flag is ignored on purpose in both
1406 * blk_rq_bytes() and in blk_update_request().
1407 *
1408 * Return:
1409 * %false - this request doesn't have any more data
1410 * %true - this request has more data
1411 **/
1412 bool blk_update_request(struct request *req, blk_status_t error,
1413 unsigned int nr_bytes)
1414 {
1415 int total_bytes;
1416
1417 trace_block_rq_complete(req, blk_status_to_errno(error), nr_bytes);
1418
1419 if (!req->bio)
1420 return false;
1421
1422 if (req_op(req) == REQ_OP_READ && error == BLK_STS_OK &&
1423 t10_pi_need_remap(rq))
1424 t10_pi_type1_complete(req, nr_bytes);
1425
1426 if (unlikely(error && !blk_rq_is_passthrough(req) &&
1427 !(req->rq_flags & RQF_QUIET)))
1428 print_req_error(req, error, __func__);
1429
1430 blk_account_io_completion(req, nr_bytes);
1431
1432 total_bytes = 0;
1433 while (req->bio) {
1434 struct bio *bio = req->bio;
1435 unsigned bio_bytes = min(bio->bi_iter.bi_size, nr_bytes);
1436
1437 if (bio_bytes == bio->bi_iter.bi_size)
1438 req->bio = bio->bi_next;
1439
1440 /* Completion has already been traced */
1441 bio_clear_flag(bio, BIO_TRACE_COMPLETION);
1442 req_bio_endio(req, bio, bio_bytes, error);
1443
1444 total_bytes += bio_bytes;
1445 nr_bytes -= bio_bytes;
1446
1447 if (!nr_bytes)
1448 break;
1449 }
1450
1451 /*
1452 * completely done
1453 */
1454 if (!req->bio) {
1455 /*
1456 * Reset counters so that the request stacking driver
1457 * can find how many bytes remain in the request
1458 * later.
1459 */
1460 req->__data_len = 0;
1461 return false;
1462 }
1463
1464 req->__data_len -= total_bytes;
1465
1466 /* update sector only for requests with clear definition of sector */
1467 if (!blk_rq_is_passthrough(req))
1468 req->__sector += total_bytes >> 9;
1469
1470 /* mixed attributes always follow the first bio */
1471 if (req->rq_flags & RQF_MIXED_MERGE) {
1472 req->cmd_flags &= ~REQ_FAILFAST_MASK;
1473 req->cmd_flags |= req->bio->bi_opf & REQ_FAILFAST_MASK;
1474 }
1475
1476 if (!(req->rq_flags & RQF_SPECIAL_PAYLOAD)) {
1477 /*
1478 * If total number of sectors is less than the first segment
1479 * size, something has gone terribly wrong.
1480 */
1481 if (blk_rq_bytes(req) < blk_rq_cur_bytes(req)) {
1482 blk_dump_rq_flags(req, "request botched");
1483 req->__data_len = blk_rq_cur_bytes(req);
1484 }
1485
1486 /* recalculate the number of segments */
1487 req->nr_phys_segments = blk_recalc_rq_segments(req);
1488 }
1489
1490 return true;
1491 }
1492 EXPORT_SYMBOL_GPL(blk_update_request);
1493
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org