Commit 4b1a25f0 authored by Peng Tao's avatar Peng Tao Committed by Greg Kroah-Hartman
Browse files

staging/lustre: fix build when CONFIG_UIDGID_STRICT_TYPE_CHECKS is on



kuid_t/kgid_t are wrappered when CONFIG_UIDGID_STRICT_TYPE_CHECKS is on.
Lustre build is broken because we always treat them as plain __u32.
The patch fixes it. Internally, Lustre always use __u32 uid/gid, and
convert to kuid_t/kgid_t when necessary.

Signed-off-by: default avatarPeng Tao <tao.peng@emc.com>
Signed-off-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9147dc8d
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -49,8 +49,6 @@
 * Implemented in portals/include/libcfs/<os>/
 */
int    cfs_curproc_groups_nr(void);
int    current_is_in_group(gid_t group);
void   cfs_curproc_groups_dump(gid_t *array, int size);

/*
 * Plus, platform-specific constant
+4 −4
Original line number Diff line number Diff line
@@ -54,10 +54,10 @@
/* simple.c */

struct lvfs_ucred {
	__u32		   luc_uid;
	__u32		   luc_gid;
	__u32		   luc_fsuid;
	__u32		   luc_fsgid;
	kuid_t		luc_uid;
	kgid_t		luc_gid;
	kuid_t		luc_fsuid;
	kgid_t		luc_fsgid;
	kernel_cap_t	luc_cap;
	__u32		   luc_umask;
	struct group_info      *luc_ginfo;
+0 −4
Original line number Diff line number Diff line
@@ -290,10 +290,6 @@ static inline int lustre_cfg_sanity_check(void *buf, int len)

#include <lustre/lustre_user.h>

#ifndef INVALID_UID
#define INVALID_UID     (-1)
#endif

/** @} cfg */

#endif // _LUSTRE_CFG_H
+0 −16
Original line number Diff line number Diff line
@@ -65,20 +65,6 @@ int cfs_curproc_groups_nr(void)
	return nr;
}

void   cfs_curproc_groups_dump(gid_t *array, int size)
{
	task_lock(current);
	size = min_t(int, size, current_cred()->group_info->ngroups);
	memcpy(array, current_cred()->group_info->blocks[0], size * sizeof(__u32));
	task_unlock(current);
}


int    current_is_in_group(gid_t gid)
{
	return in_group_p(gid);
}

/* Currently all the CFS_CAP_* defines match CAP_* ones. */
#define cfs_cap_pack(cap) (cap)
#define cfs_cap_unpack(cap) (cap)
@@ -318,8 +304,6 @@ out:
EXPORT_SYMBOL(cfs_get_environ);

EXPORT_SYMBOL(cfs_curproc_groups_nr);
EXPORT_SYMBOL(cfs_curproc_groups_dump);
EXPORT_SYMBOL(current_is_in_group);
EXPORT_SYMBOL(cfs_cap_raise);
EXPORT_SYMBOL(cfs_cap_lower);
EXPORT_SYMBOL(cfs_cap_raised);
+1 −1
Original line number Diff line number Diff line
@@ -137,7 +137,7 @@ static long libcfs_ioctl(struct file *file,
	struct cfs_psdev_file	 pfile;
	int    rc = 0;

	if (current_fsuid() != 0)
	if (!capable(CAP_SYS_ADMIN))
		return -EACCES;

	if ( _IOC_TYPE(cmd) != IOC_LIBCFS_TYPE ||
Loading