[ceph-client:testing 10/10] include/linux/ceph/pagelist.h:76:11: error: 'ERANGE' undeclared

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://github.com/ceph/ceph-client.git testing
head:   e44e41fbcdc053bb569518e84dd0ddb85ecca912
commit: e44e41fbcdc053bb569518e84dd0ddb85ecca912 [10/10] libceph: check string length in ceph_pagelist_encode_string() for safety
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 8.1.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 e44e41fbcdc053bb569518e84dd0ddb85ecca912
        # save the attached .config to linux build tree
        GCC_VERSION=8.1.0 make.cross ARCH=xtensa 

All errors (new ones prefixed by >>):

   In file included from fs/ceph/xattr.c:3:
   include/linux/ceph/pagelist.h: In function 'ceph_pagelist_encode_string':
>> include/linux/ceph/pagelist.h:76:11: error: 'ERANGE' undeclared (first use in this function)
      return -ERANGE;
              ^~~~~~
   include/linux/ceph/pagelist.h:76:11: note: each undeclared identifier is reported only once for each function it appears in

vim +/ERANGE +76 include/linux/ceph/pagelist.h

    44	
    45	extern void ceph_pagelist_set_cursor(struct ceph_pagelist *pl,
    46					     struct ceph_pagelist_cursor *c);
    47	
    48	extern int ceph_pagelist_truncate(struct ceph_pagelist *pl,
    49					  struct ceph_pagelist_cursor *c);
    50	
    51	static inline int ceph_pagelist_encode_64(struct ceph_pagelist *pl, u64 v)
    52	{
    53		__le64 ev = cpu_to_le64(v);
    54		return ceph_pagelist_append(pl, &ev, sizeof(ev));
    55	}
    56	static inline int ceph_pagelist_encode_32(struct ceph_pagelist *pl, u32 v)
    57	{
    58		__le32 ev = cpu_to_le32(v);
    59		return ceph_pagelist_append(pl, &ev, sizeof(ev));
    60	}
    61	static inline int ceph_pagelist_encode_16(struct ceph_pagelist *pl, u16 v)
    62	{
    63		__le16 ev = cpu_to_le16(v);
    64		return ceph_pagelist_append(pl, &ev, sizeof(ev));
    65	}
    66	static inline int ceph_pagelist_encode_8(struct ceph_pagelist *pl, u8 v)
    67	{
    68		return ceph_pagelist_append(pl, &v, 1);
    69	}
    70	static inline int ceph_pagelist_encode_string(struct ceph_pagelist *pl,
    71						      char *s, size_t len)
    72	{
    73		int ret;
    74	
    75		if (len > U32_MAX)
  > 76			return -ERANGE;
    77		ret = ceph_pagelist_encode_32(pl, len);
    78		if (ret)
    79			return ret;
    80		if (len)
    81			return ceph_pagelist_append(pl, s, len);
    82		return 0;
    83	}
    84	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux