tree: https://github.com/ceph/ceph-client.git wip-fancy-striping-testing head: d1166a1858df30a8f52bfca85fdc56e14aef3033 commit: 46904a4e44ad096cbfaa77a5ad9934b996616995 [32/54] rbd: new request handling code config: cris-allmodconfig (attached as .config) compiler: cris-linux-gcc (GCC) 7.2.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross git checkout 46904a4e44ad096cbfaa77a5ad9934b996616995 # save the attached .config to linux build tree make.cross ARCH=cris All warnings (new ones prefixed by >>): drivers//block/rbd.c: In function 'rbd_img_is_write': >> drivers//block/rbd.c:1628:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ drivers//block/rbd.c: In function '__rbd_obj_handle_request': drivers//block/rbd.c:3334:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ drivers//block/rbd.c: In function 'rbd_obj_handle_write': drivers//block/rbd.c:3309:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ At top level: drivers//block/rbd.c:1750:13: warning: 'rbd_osd_call_callback' defined but not used [-Wunused-function] static void rbd_osd_call_callback(struct rbd_obj_request *obj_request) ^~~~~~~~~~~~~~~~~~~~~ drivers//block/rbd.c:1744:13: warning: 'rbd_osd_stat_callback' defined but not used [-Wunused-function] static void rbd_osd_stat_callback(struct rbd_obj_request *obj_request) ^~~~~~~~~~~~~~~~~~~~~ drivers//block/rbd.c:1725:13: warning: 'rbd_osd_discard_callback' defined but not used [-Wunused-function] static void rbd_osd_discard_callback(struct rbd_obj_request *obj_request) ^~~~~~~~~~~~~~~~~~~~~~~~ drivers//block/rbd.c:1713:13: warning: 'rbd_osd_write_callback' defined but not used [-Wunused-function] static void rbd_osd_write_callback(struct rbd_obj_request *obj_request) ^~~~~~~~~~~~~~~~~~~~~~ drivers//block/rbd.c:1689:13: warning: 'rbd_osd_read_callback' defined but not used [-Wunused-function] static void rbd_osd_read_callback(struct rbd_obj_request *obj_request) ^~~~~~~~~~~~~~~~~~~~~ drivers//block/rbd.c: In function 'rbd_obj_read_from_parent': >> drivers//block/rbd.c:2971:5: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized] if (ret) { ^ vim +1628 drivers//block/rbd.c 1616 1617 static bool rbd_img_is_write(struct rbd_img_request *img_req) 1618 { 1619 switch (rbd_img_request_op_type(img_req)) { 1620 case OBJ_OP_READ: 1621 return false; 1622 case OBJ_OP_WRITE: 1623 case OBJ_OP_DISCARD: 1624 return true; 1625 default: 1626 rbd_assert(0); 1627 } > 1628 } 1629 1630 static void 1631 rbd_img_obj_request_read_callback(struct rbd_obj_request *obj_request) 1632 { 1633 u64 xferred = obj_request->xferred; 1634 u64 length = obj_request->length; 1635 1636 dout("%s: obj %p img %p result %d %llu/%llu\n", __func__, 1637 obj_request, obj_request->img_request, obj_request->result, 1638 xferred, length); 1639 /* 1640 * ENOENT means a hole in the image. We zero-fill the entire 1641 * length of the request. A short read also implies zero-fill 1642 * to the end of the request. An error requires the whole 1643 * length of the request to be reported finished with an error 1644 * to the block layer. In each case we update the xferred 1645 * count to indicate the whole request was satisfied. 1646 */ 1647 rbd_assert(obj_request->type != OBJ_REQUEST_NODATA); 1648 if (obj_request->result == -ENOENT) { 1649 if (obj_request->type == OBJ_REQUEST_BIO) 1650 zero_bios(&obj_request->bio_pos, 0, length); 1651 else 1652 zero_bvecs(&obj_request->bvec_pos, 0, length); 1653 obj_request->result = 0; 1654 } else if (xferred < length && !obj_request->result) { 1655 if (obj_request->type == OBJ_REQUEST_BIO) 1656 zero_bios(&obj_request->bio_pos, xferred, 1657 length - xferred); 1658 else 1659 zero_bvecs(&obj_request->bvec_pos, xferred, 1660 length - xferred); 1661 } 1662 obj_request->xferred = length; 1663 obj_request_done_set(obj_request); 1664 } 1665 1666 static void rbd_obj_request_complete(struct rbd_obj_request *obj_request) 1667 { 1668 dout("%s: obj %p cb %p\n", __func__, obj_request, 1669 obj_request->callback); 1670 obj_request->callback(obj_request); 1671 } 1672 1673 static void rbd_obj_request_error(struct rbd_obj_request *obj_request, int err) 1674 { 1675 obj_request->result = err; 1676 obj_request->xferred = 0; 1677 /* 1678 * kludge - mirror rbd_obj_request_submit() to match a put in 1679 * rbd_img_obj_callback() 1680 */ 1681 if (obj_request_img_data_test(obj_request)) { 1682 WARN_ON(obj_request->callback != rbd_img_obj_callback); 1683 rbd_img_request_get(obj_request->img_request); 1684 } 1685 obj_request_done_set(obj_request); 1686 rbd_obj_request_complete(obj_request); 1687 } 1688 1689 static void rbd_osd_read_callback(struct rbd_obj_request *obj_request) 1690 { 1691 struct rbd_img_request *img_request = NULL; 1692 struct rbd_device *rbd_dev = NULL; 1693 bool layered = false; 1694 1695 if (obj_request_img_data_test(obj_request)) { 1696 img_request = obj_request->img_request; 1697 layered = img_request && img_request_layered_test(img_request); 1698 rbd_dev = img_request->rbd_dev; 1699 } 1700 1701 dout("%s: obj %p img %p result %d %llu/%llu\n", __func__, 1702 obj_request, img_request, obj_request->result, 1703 obj_request->xferred, obj_request->length); 1704 if (layered && obj_request->result == -ENOENT && 1705 obj_request->img_offset < rbd_dev->parent_overlap) 1706 rbd_img_parent_read(obj_request); 1707 else if (img_request) 1708 rbd_img_obj_request_read_callback(obj_request); 1709 else 1710 obj_request_done_set(obj_request); 1711 } 1712 > 1713 static void rbd_osd_write_callback(struct rbd_obj_request *obj_request) 1714 { 1715 dout("%s: obj %p result %d %llu\n", __func__, obj_request, 1716 obj_request->result, obj_request->length); 1717 /* 1718 * There is no such thing as a successful short write. Set 1719 * it to our originally-requested length. 1720 */ 1721 obj_request->xferred = obj_request->length; 1722 obj_request_done_set(obj_request); 1723 } 1724 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip