All of lore.kernel.org
 help / color / mirror / Atom feed
* [jlayton:ceph-fscrypt 56/64] fs/ceph/caps.c:1409:29: warning: incompatible pointer to integer conversion passing '__le64 *' (aka 'unsigned long long *') to parameter of type 'int'
@ 2021-06-29  3:21 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-06-29  3:21 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 7292 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git ceph-fscrypt
head:   5cba1e2447b729e1fde99e558356afce93c40b17
commit: eae7682179111ae28eb6165188034f225c81451d [56/64] ceph: add proper size handling for encrypted inodes
config: x86_64-randconfig-a002-20210628 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 4c92e31dd0f1bd152eda883af20ff7fbcaa14945)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git/commit/?id=eae7682179111ae28eb6165188034f225c81451d
        git remote add jlayton https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git
        git fetch --no-tags jlayton ceph-fscrypt
        git checkout eae7682179111ae28eb6165188034f225c81451d
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   fs/ceph/caps.c:1407:30: error: use of undeclared identifier 'CEPH_FSCRYPT_BLOCK_SIZE'
                   arg->size = round_up(size, CEPH_FSCRYPT_BLOCK_SIZE);
                                              ^
>> fs/ceph/caps.c:1409:29: warning: incompatible pointer to integer conversion passing '__le64 *' (aka 'unsigned long long *') to parameter of type 'int' [-Wint-conversion]
                   memset(arg->fscrypt_file, &esize, sizeof(esize));
                                             ^~~~~~
   arch/x86/include/asm/string_64.h:18:27: note: passing argument to parameter 'c' here
   void *memset(void *s, int c, size_t n);
                             ^
   fs/ceph/caps.c:1530:38: error: use of undeclared identifier 'CEPH_FSCRYPT_BLOCK_SIZE'
                   arg.size = round_up(capsnap->size, CEPH_FSCRYPT_BLOCK_SIZE);
                                                      ^
   fs/ceph/caps.c:1532:20: error: array type 'u8 [8]' is not assignable
                   arg.fscrypt_file = cpu_to_le64(capsnap->size);
                   ~~~~~~~~~~~~~~~~ ^
   1 warning and 3 errors generated.


vim +1409 fs/ceph/caps.c

  1355	
  1356	/*
  1357	 * Prepare to send a cap message to an MDS. Update the cap state, and populate
  1358	 * the arg struct with the parameters that will need to be sent. This should
  1359	 * be done under the i_ceph_lock to guard against changes to cap state.
  1360	 *
  1361	 * Make note of max_size reported/requested from mds, revoked caps
  1362	 * that have now been implemented.
  1363	 */
  1364	static void __prep_cap(struct cap_msg_args *arg, struct ceph_cap *cap,
  1365			       int op, int flags, int used, int want, int retain,
  1366			       int flushing, u64 flush_tid, u64 oldest_flush_tid)
  1367	{
  1368		struct ceph_inode_info *ci = cap->ci;
  1369		struct inode *inode = &ci->vfs_inode;
  1370		int held, revoking;
  1371	
  1372		lockdep_assert_held(&ci->i_ceph_lock);
  1373	
  1374		held = cap->issued | cap->implemented;
  1375		revoking = cap->implemented & ~cap->issued;
  1376		retain &= ~revoking;
  1377	
  1378		dout("%s %p cap %p session %p %s -> %s (revoking %s)\n",
  1379		     __func__, inode, cap, cap->session,
  1380		     ceph_cap_string(held), ceph_cap_string(held & retain),
  1381		     ceph_cap_string(revoking));
  1382		BUG_ON((retain & CEPH_CAP_PIN) == 0);
  1383	
  1384		ci->i_ceph_flags &= ~CEPH_I_FLUSH;
  1385	
  1386		cap->issued &= retain;  /* drop bits we don't want */
  1387		/*
  1388		 * Wake up any waiters on wanted -> needed transition. This is due to
  1389		 * the weird transition from buffered to sync IO... we need to flush
  1390		 * dirty pages _before_ allowing sync writes to avoid reordering.
  1391		 */
  1392		arg->wake = cap->implemented & ~cap->issued;
  1393		cap->implemented &= cap->issued | used;
  1394		cap->mds_wanted = want;
  1395	
  1396		arg->session = cap->session;
  1397		arg->ino = ceph_vino(inode).ino;
  1398		arg->cid = cap->cap_id;
  1399		arg->follows = flushing ? ci->i_head_snapc->seq : 0;
  1400		arg->flush_tid = flush_tid;
  1401		arg->oldest_flush_tid = oldest_flush_tid;
  1402	
  1403		if (IS_ENCRYPTED(inode)) {
  1404			u64 size = i_size_read(inode);
  1405			__le64 esize = cpu_to_le64(size);
  1406	
  1407			arg->size = round_up(size, CEPH_FSCRYPT_BLOCK_SIZE);
  1408			arg->fscrypt_file_len = sizeof(__le64);
> 1409			memset(arg->fscrypt_file, &esize, sizeof(esize));
  1410		} else {
  1411			arg->size = i_size_read(inode);
  1412			arg->fscrypt_file_len = 0;
  1413		}
  1414		ci->i_reported_size = arg->size;
  1415		arg->max_size = ci->i_wanted_max_size;
  1416		if (cap == ci->i_auth_cap) {
  1417			if (want & CEPH_CAP_ANY_FILE_WR)
  1418				ci->i_requested_max_size = arg->max_size;
  1419			else
  1420				ci->i_requested_max_size = 0;
  1421		}
  1422	
  1423		if (flushing & CEPH_CAP_XATTR_EXCL) {
  1424			arg->old_xattr_buf = __ceph_build_xattrs_blob(ci);
  1425			arg->xattr_version = ci->i_xattrs.version;
  1426			arg->xattr_buf = ci->i_xattrs.blob;
  1427		} else {
  1428			arg->xattr_buf = NULL;
  1429			arg->old_xattr_buf = NULL;
  1430		}
  1431	
  1432		arg->mtime = inode->i_mtime;
  1433		arg->atime = inode->i_atime;
  1434		arg->ctime = inode->i_ctime;
  1435		arg->btime = ci->i_btime;
  1436		arg->change_attr = inode_peek_iversion_raw(inode);
  1437	
  1438		arg->op = op;
  1439		arg->caps = cap->implemented;
  1440		arg->wanted = want;
  1441		arg->dirty = flushing;
  1442	
  1443		arg->seq = cap->seq;
  1444		arg->issue_seq = cap->issue_seq;
  1445		arg->mseq = cap->mseq;
  1446		arg->time_warp_seq = ci->i_time_warp_seq;
  1447	
  1448		arg->uid = inode->i_uid;
  1449		arg->gid = inode->i_gid;
  1450		arg->mode = inode->i_mode;
  1451	
  1452		arg->inline_data = ci->i_inline_version != CEPH_INLINE_NONE;
  1453		if (!(flags & CEPH_CLIENT_CAPS_PENDING_CAPSNAP) &&
  1454		    !list_empty(&ci->i_cap_snaps)) {
  1455			struct ceph_cap_snap *capsnap;
  1456			list_for_each_entry_reverse(capsnap, &ci->i_cap_snaps, ci_item) {
  1457				if (capsnap->cap_flush.tid)
  1458					break;
  1459				if (capsnap->need_flush) {
  1460					flags |= CEPH_CLIENT_CAPS_PENDING_CAPSNAP;
  1461					break;
  1462				}
  1463			}
  1464		}
  1465		arg->flags = flags;
  1466		if (ci->fscrypt_auth_len &&
  1467		    WARN_ON_ONCE(ci->fscrypt_auth_len != sizeof(struct ceph_fscrypt_auth))) {
  1468			/* Don't set this if it isn't right size */
  1469			arg->fscrypt_auth_len = 0;
  1470		} else {
  1471			arg->fscrypt_auth_len = ci->fscrypt_auth_len;
  1472			memcpy(arg->fscrypt_auth, ci->fscrypt_auth,
  1473				min_t(size_t, ci->fscrypt_auth_len, sizeof(arg->fscrypt_auth)));
  1474		}
  1475	}
  1476	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 45387 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-29  3:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-29  3:21 [jlayton:ceph-fscrypt 56/64] fs/ceph/caps.c:1409:29: warning: incompatible pointer to integer conversion passing '__le64 *' (aka 'unsigned long long *') to parameter of type 'int' kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.