tree: https://github.com/ceph/ceph-client.git testing head: 5069dc1800a72380905a2083a57d1311b96bb5d9 commit: 5069dc1800a72380905a2083a57d1311b96bb5d9 [3/3] rbd: support cloning across namespaces config: sparc64-allyesconfig (attached as .config) compiler: sparc64-linux-gnu-gcc (Debian 7.2.0-11) 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 5069dc1800a72380905a2083a57d1311b96bb5d9 # save the attached .config to linux build tree GCC_VERSION=7.2.0 make.cross ARCH=sparc64 Note: it may well be a FALSE warning. FWIW you are at least aware of it now. http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings All warnings (new ones prefixed by >>): drivers/block/rbd.c: In function 'rbd_dev_v2_parent_info': >> drivers/block/rbd.c:4817:26: warning: 'overlap' may be used uninitialized in this function [-Wmaybe-uninitialized] rbd_dev->parent_overlap = overlap; ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~ vim +/overlap +4817 drivers/block/rbd.c 617906a2 Ilya Dryomov 2018-08-22 4733 86b00e0d Alex Elder 2012-10-25 4734 static int rbd_dev_v2_parent_info(struct rbd_device *rbd_dev) 86b00e0d Alex Elder 2012-10-25 4735 { 86b00e0d Alex Elder 2012-10-25 4736 struct rbd_spec *parent_spec; 617906a2 Ilya Dryomov 2018-08-22 4737 struct parent_image_spec pis = { 0 }; 86b00e0d Alex Elder 2012-10-25 4738 u64 overlap; 86b00e0d Alex Elder 2012-10-25 4739 int ret; 86b00e0d Alex Elder 2012-10-25 4740 86b00e0d Alex Elder 2012-10-25 4741 parent_spec = rbd_spec_alloc(); 86b00e0d Alex Elder 2012-10-25 4742 if (!parent_spec) 86b00e0d Alex Elder 2012-10-25 4743 return -ENOMEM; 86b00e0d Alex Elder 2012-10-25 4744 5069dc18 Ilya Dryomov 2018-08-22 4745 ret = get_parent_info(rbd_dev, &pis, &overlap); 5069dc18 Ilya Dryomov 2018-08-22 4746 if (ret == -EOPNOTSUPP) 617906a2 Ilya Dryomov 2018-08-22 4747 ret = get_parent_info_legacy(rbd_dev, &pis, &overlap); 617906a2 Ilya Dryomov 2018-08-22 4748 if (ret) 86b00e0d Alex Elder 2012-10-25 4749 goto out_err; 5069dc18 Ilya Dryomov 2018-08-22 4750 dout("%s pool_id %llu pool_ns %s image_id %s snap_id %llu overlap %llu\n", 5069dc18 Ilya Dryomov 2018-08-22 4751 __func__, pis.pool_id, pis.pool_ns, pis.image_id, pis.snap_id, 617906a2 Ilya Dryomov 2018-08-22 4752 overlap); 86b00e0d Alex Elder 2012-10-25 4753 617906a2 Ilya Dryomov 2018-08-22 4754 if (pis.pool_id == CEPH_NOPOOL) { 392a9dad Alex Elder 2013-05-06 4755 /* 392a9dad Alex Elder 2013-05-06 4756 * Either the parent never existed, or we have 392a9dad Alex Elder 2013-05-06 4757 * record of it but the image got flattened so it no 392a9dad Alex Elder 2013-05-06 4758 * longer has a parent. When the parent of a 392a9dad Alex Elder 2013-05-06 4759 * layered image disappears we immediately set the 392a9dad Alex Elder 2013-05-06 4760 * overlap to 0. The effect of this is that all new 392a9dad Alex Elder 2013-05-06 4761 * requests will be treated as if the image had no 392a9dad Alex Elder 2013-05-06 4762 * parent. 392a9dad Alex Elder 2013-05-06 4763 */ 392a9dad Alex Elder 2013-05-06 4764 if (rbd_dev->parent_overlap) { 392a9dad Alex Elder 2013-05-06 4765 rbd_dev->parent_overlap = 0; 392a9dad Alex Elder 2013-05-06 4766 rbd_dev_parent_put(rbd_dev); 392a9dad Alex Elder 2013-05-06 4767 pr_info("%s: clone image has been flattened\n", 392a9dad Alex Elder 2013-05-06 4768 rbd_dev->disk->disk_name); 392a9dad Alex Elder 2013-05-06 4769 } 392a9dad Alex Elder 2013-05-06 4770 86b00e0d Alex Elder 2012-10-25 4771 goto out; /* No parent? No problem. */ 392a9dad Alex Elder 2013-05-06 4772 } 86b00e0d Alex Elder 2012-10-25 4773 0903e875 Alex Elder 2012-11-14 4774 /* The ceph file layout needs to fit pool id in 32 bits */ 0903e875 Alex Elder 2012-11-14 4775 0903e875 Alex Elder 2012-11-14 4776 ret = -EIO; 617906a2 Ilya Dryomov 2018-08-22 4777 if (pis.pool_id > (u64)U32_MAX) { 9584d508 Ilya Dryomov 2014-07-11 4778 rbd_warn(NULL, "parent pool id too large (%llu > %u)", 617906a2 Ilya Dryomov 2018-08-22 4779 (unsigned long long)pis.pool_id, U32_MAX); 86b00e0d Alex Elder 2012-10-25 4780 goto out_err; 86b00e0d Alex Elder 2012-10-25 4781 } 86b00e0d Alex Elder 2012-10-25 4782 3b5cf2a2 Alex Elder 2013-05-29 4783 /* 3b5cf2a2 Alex Elder 2013-05-29 4784 * The parent won't change (except when the clone is 3b5cf2a2 Alex Elder 2013-05-29 4785 * flattened, already handled that). So we only need to 3b5cf2a2 Alex Elder 2013-05-29 4786 * record the parent spec we have not already done so. 3b5cf2a2 Alex Elder 2013-05-29 4787 */ 3b5cf2a2 Alex Elder 2013-05-29 4788 if (!rbd_dev->parent_spec) { 617906a2 Ilya Dryomov 2018-08-22 4789 parent_spec->pool_id = pis.pool_id; 5069dc18 Ilya Dryomov 2018-08-22 4790 if (pis.pool_ns && *pis.pool_ns) { 5069dc18 Ilya Dryomov 2018-08-22 4791 parent_spec->pool_ns = pis.pool_ns; 5069dc18 Ilya Dryomov 2018-08-22 4792 pis.pool_ns = NULL; 5069dc18 Ilya Dryomov 2018-08-22 4793 } 617906a2 Ilya Dryomov 2018-08-22 4794 parent_spec->image_id = pis.image_id; 617906a2 Ilya Dryomov 2018-08-22 4795 pis.image_id = NULL; 617906a2 Ilya Dryomov 2018-08-22 4796 parent_spec->snap_id = pis.snap_id; b26c047b Ilya Dryomov 2018-07-03 4797 86b00e0d Alex Elder 2012-10-25 4798 rbd_dev->parent_spec = parent_spec; 86b00e0d Alex Elder 2012-10-25 4799 parent_spec = NULL; /* rbd_dev now owns this */ 3b5cf2a2 Alex Elder 2013-05-29 4800 } 3b5cf2a2 Alex Elder 2013-05-29 4801 3b5cf2a2 Alex Elder 2013-05-29 4802 /* cf32bd9c Ilya Dryomov 2015-01-19 4803 * We always update the parent overlap. If it's zero we issue cf32bd9c Ilya Dryomov 2015-01-19 4804 * a warning, as we will proceed as if there was no parent. 3b5cf2a2 Alex Elder 2013-05-29 4805 */ 3b5cf2a2 Alex Elder 2013-05-29 4806 if (!overlap) { 3b5cf2a2 Alex Elder 2013-05-29 4807 if (parent_spec) { cf32bd9c Ilya Dryomov 2015-01-19 4808 /* refresh, careful to warn just once */ cf32bd9c Ilya Dryomov 2015-01-19 4809 if (rbd_dev->parent_overlap) cf32bd9c Ilya Dryomov 2015-01-19 4810 rbd_warn(rbd_dev, cf32bd9c Ilya Dryomov 2015-01-19 4811 "clone now standalone (overlap became 0)"); 70cf49cf Alex Elder 2013-05-06 4812 } else { cf32bd9c Ilya Dryomov 2015-01-19 4813 /* initial probe */ cf32bd9c Ilya Dryomov 2015-01-19 4814 rbd_warn(rbd_dev, "clone is standalone (overlap 0)"); 3b5cf2a2 Alex Elder 2013-05-29 4815 } 70cf49cf Alex Elder 2013-05-06 4816 } cf32bd9c Ilya Dryomov 2015-01-19 @4817 rbd_dev->parent_overlap = overlap; cf32bd9c Ilya Dryomov 2015-01-19 4818 86b00e0d Alex Elder 2012-10-25 4819 out: 86b00e0d Alex Elder 2012-10-25 4820 ret = 0; 86b00e0d Alex Elder 2012-10-25 4821 out_err: 5069dc18 Ilya Dryomov 2018-08-22 4822 kfree(pis.pool_ns); 617906a2 Ilya Dryomov 2018-08-22 4823 kfree(pis.image_id); 86b00e0d Alex Elder 2012-10-25 4824 rbd_spec_put(parent_spec); 86b00e0d Alex Elder 2012-10-25 4825 return ret; 86b00e0d Alex Elder 2012-10-25 4826 } 86b00e0d Alex Elder 2012-10-25 4827 :::::: The code at line 4817 was first introduced by commit :::::: cf32bd9c86b6917d8446c00ea0081dde6e716a82 rbd: do not treat standalone as flatten :::::: TO: Ilya Dryomov <idryomov@xxxxxxxxxx> :::::: CC: Ilya Dryomov <idryomov@xxxxxxxxx> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip