All of lore.kernel.org
 help / color / mirror / Atom feed
* [djwong-xfs:verifier-fixes 133/133] fs/xfs/xfs_acl.c:38:56: warning: passing argument 4 of 'xfs_corruption_error' discards 'const' qualifier from pointer target type
@ 2019-10-20 11:37 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2019-10-20 11:37 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git verifier-fixes
head:   5667161cc9c0d336176b9e176102b0d2a8b65868
commit: 5667161cc9c0d336176b9e176102b0d2a8b65868 [133/133] xfs: always log corruption errors
config: x86_64-rhel-7.6 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-14) 7.4.0
reproduce:
        git checkout 5667161cc9c0d336176b9e176102b0d2a8b65868
        # save the attached .config to linux build tree
        make ARCH=x86_64 

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

All warnings (new ones prefixed by >>):

   In file included from fs/xfs/xfs_acl.c:15:0:
   fs/xfs/xfs_acl.c: In function 'xfs_acl_from_disk':
>> fs/xfs/xfs_acl.c:38:56: warning: passing argument 4 of 'xfs_corruption_error' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
      XFS_CORRUPTION_ERROR(__func__, XFS_ERRLEVEL_LOW, mp, aclp,
                                                           ^
   fs/xfs/xfs_error.h:30:35: note: in definition of macro 'XFS_CORRUPTION_ERROR'
     xfs_corruption_error(e, lvl, mp, buf, bufsize, \
                                      ^~~
   fs/xfs/xfs_error.h:14:13: note: expected 'void *' but argument is of type 'const struct xfs_acl *'
    extern void xfs_corruption_error(const char *tag, int level,
                ^~~~~~~~~~~~~~~~~~~~
   fs/xfs/xfs_acl.c:45:56: warning: passing argument 4 of 'xfs_corruption_error' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
      XFS_CORRUPTION_ERROR(__func__, XFS_ERRLEVEL_LOW, mp, aclp,
                                                           ^
   fs/xfs/xfs_error.h:30:35: note: in definition of macro 'XFS_CORRUPTION_ERROR'
     xfs_corruption_error(e, lvl, mp, buf, bufsize, \
                                      ^~~
   fs/xfs/xfs_error.h:14:13: note: expected 'void *' but argument is of type 'const struct xfs_acl *'
    extern void xfs_corruption_error(const char *tag, int level,
                ^~~~~~~~~~~~~~~~~~~~

vim +38 fs/xfs/xfs_acl.c

  > 15	#include "xfs_error.h"
    16	#include <linux/posix_acl_xattr.h>
    17	
    18	
    19	/*
    20	 * Locking scheme:
    21	 *  - all ACL updates are protected by inode->i_mutex, which is taken before
    22	 *    calling into this file.
    23	 */
    24	
    25	STATIC struct posix_acl *
    26	xfs_acl_from_disk(
    27		struct xfs_mount	*mp,
    28		const struct xfs_acl	*aclp,
    29		int			len,
    30		int			max_entries)
    31	{
    32		struct posix_acl_entry *acl_e;
    33		struct posix_acl *acl;
    34		const struct xfs_acl_entry *ace;
    35		unsigned int count, i;
    36	
    37		if (len < sizeof(*aclp)) {
  > 38			XFS_CORRUPTION_ERROR(__func__, XFS_ERRLEVEL_LOW, mp, aclp,
    39					len);
    40			return ERR_PTR(-EFSCORRUPTED);
    41		}
    42	
    43		count = be32_to_cpu(aclp->acl_cnt);
    44		if (count > max_entries || XFS_ACL_SIZE(count) != len) {
    45			XFS_CORRUPTION_ERROR(__func__, XFS_ERRLEVEL_LOW, mp, aclp,
    46					len);
    47			return ERR_PTR(-EFSCORRUPTED);
    48		}
    49	
    50		acl = posix_acl_alloc(count, GFP_KERNEL);
    51		if (!acl)
    52			return ERR_PTR(-ENOMEM);
    53	
    54		for (i = 0; i < count; i++) {
    55			acl_e = &acl->a_entries[i];
    56			ace = &aclp->acl_entry[i];
    57	
    58			/*
    59			 * The tag is 32 bits on disk and 16 bits in core.
    60			 *
    61			 * Because every access to it goes through the core
    62			 * format first this is not a problem.
    63			 */
    64			acl_e->e_tag = be32_to_cpu(ace->ae_tag);
    65			acl_e->e_perm = be16_to_cpu(ace->ae_perm);
    66	
    67			switch (acl_e->e_tag) {
    68			case ACL_USER:
    69				acl_e->e_uid = xfs_uid_to_kuid(be32_to_cpu(ace->ae_id));
    70				break;
    71			case ACL_GROUP:
    72				acl_e->e_gid = xfs_gid_to_kgid(be32_to_cpu(ace->ae_id));
    73				break;
    74			case ACL_USER_OBJ:
    75			case ACL_GROUP_OBJ:
    76			case ACL_MASK:
    77			case ACL_OTHER:
    78				break;
    79			default:
    80				goto fail;
    81			}
    82		}
    83		return acl;
    84	
    85	fail:
    86		posix_acl_release(acl);
    87		return ERR_PTR(-EINVAL);
    88	}
    89	

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

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

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

only message in thread, other threads:[~2019-10-20 11:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-20 11:37 [djwong-xfs:verifier-fixes 133/133] fs/xfs/xfs_acl.c:38:56: warning: passing argument 4 of 'xfs_corruption_error' discards 'const' qualifier from pointer target type kbuild 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.