CC: [email protected] CC: [email protected] TO: Jeff Layton <[email protected]>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git ceph-fscrypt head: 3f014b82b65ebbf30b8e4cd0b307f1f2794d183f commit: 3f014b82b65ebbf30b8e4cd0b307f1f2794d183f [53/53] libceph: define a structure to track SPARSE_READ reply processing :::::: branch date: 16 hours ago :::::: commit date: 16 hours ago config: openrisc-randconfig-m031-20220124 (https://download.01.org/0day-ci/archive/20220129/[email protected]/config) compiler: or1k-linux-gcc (GCC) 11.2.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> New smatch warnings: net/ceph/osd_client.c:5775 osd_sparse_read() warn: statement has no effect 3 Old smatch warnings: include/linux/ceph/string_table.h:46 ceph_compare_string() error: we previously assumed 'cs' could be null (see line 41) vim +5775 net/ceph/osd_client.c 33d07337962c7b Yan, Zheng 2014-11-04 5746 3f014b82b65ebb Jeff Layton 2022-01-25 5747 static int osd_sparse_read(struct ceph_connection *con, u64 *len, char **buf) 3f014b82b65ebb Jeff Layton 2022-01-25 5748 { 3f014b82b65ebb Jeff Layton 2022-01-25 5749 struct ceph_osd *o = con->private; 3f014b82b65ebb Jeff Layton 2022-01-25 5750 struct ceph_sparse_read *sr = &o->o_sparse_read; 3f014b82b65ebb Jeff Layton 2022-01-25 5751 u32 count = __le32_to_cpu(sr->sr_count); 3f014b82b65ebb Jeff Layton 2022-01-25 5752 int ret = 1; 3f014b82b65ebb Jeff Layton 2022-01-25 5753 3f014b82b65ebb Jeff Layton 2022-01-25 5754 switch (sr->sr_state) { 3f014b82b65ebb Jeff Layton 2022-01-25 5755 case CEPH_SPARSE_READ_COUNT: 3f014b82b65ebb Jeff Layton 2022-01-25 5756 /* number of extents */ 3f014b82b65ebb Jeff Layton 2022-01-25 5757 *len = sizeof(sr->sr_count); 3f014b82b65ebb Jeff Layton 2022-01-25 5758 *buf = (char *)&sr->sr_count; 3f014b82b65ebb Jeff Layton 2022-01-25 5759 sr->sr_state = CEPH_SPARSE_READ_EXTENTS; 3f014b82b65ebb Jeff Layton 2022-01-25 5760 break; 3f014b82b65ebb Jeff Layton 2022-01-25 5761 case CEPH_SPARSE_READ_EXTENTS: 3f014b82b65ebb Jeff Layton 2022-01-25 5762 /* the extent array */ 3f014b82b65ebb Jeff Layton 2022-01-25 5763 *len = count * sizeof(*sr->sr_extent); 3f014b82b65ebb Jeff Layton 2022-01-25 5764 if (count > 1) { 3f014b82b65ebb Jeff Layton 2022-01-25 5765 /* can't use the embedded extent array */ 3f014b82b65ebb Jeff Layton 2022-01-25 5766 sr->sr_extent = kmalloc_array(count, sizeof(*sr->sr_extent), 3f014b82b65ebb Jeff Layton 2022-01-25 5767 GFP_NOIO); 3f014b82b65ebb Jeff Layton 2022-01-25 5768 if (!sr->sr_extent) 3f014b82b65ebb Jeff Layton 2022-01-25 5769 return -ENOMEM; 3f014b82b65ebb Jeff Layton 2022-01-25 5770 } 3f014b82b65ebb Jeff Layton 2022-01-25 5771 *buf = (char *)sr->sr_extent; 3f014b82b65ebb Jeff Layton 2022-01-25 5772 sr->sr_state = CEPH_SPARSE_READ_DATA; 3f014b82b65ebb Jeff Layton 2022-01-25 5773 break; 3f014b82b65ebb Jeff Layton 2022-01-25 5774 case CEPH_SPARSE_READ_DATA: 3f014b82b65ebb Jeff Layton 2022-01-25 @5775 u64 off = le64_to_cpu(sr->sr_extent[sr->sr_index].off); 3f014b82b65ebb Jeff Layton 2022-01-25 5776 u64 len = le64_to_cpu(sr->sr_extent[sr->sr_index].len); 3f014b82b65ebb Jeff Layton 2022-01-25 5777 3f014b82b65ebb Jeff Layton 2022-01-25 5778 /* ret to 0 if this is the last extent */ 3f014b82b65ebb Jeff Layton 2022-01-25 5779 ++sr->sr_index; 3f014b82b65ebb Jeff Layton 2022-01-25 5780 if (sr->sr_index >= count) 3f014b82b65ebb Jeff Layton 2022-01-25 5781 ret = 0; 3f014b82b65ebb Jeff Layton 2022-01-25 5782 break; 3f014b82b65ebb Jeff Layton 2022-01-25 5783 } 3f014b82b65ebb Jeff Layton 2022-01-25 5784 return ret; 3f014b82b65ebb Jeff Layton 2022-01-25 5785 } 3f014b82b65ebb Jeff Layton 2022-01-25 5786 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/[email protected] _______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
