[Pkg-lustre-svn-commit] r497 - in /trunk/debian: changelog patches/bug_15949_mds.body_capacity.dpatch
winnie at users.alioth.debian.org
winnie at users.alioth.debian.org
Mon Sep 15 19:41:20 UTC 2008
Author: winnie
Date: Mon Sep 15 19:41:20 2008
New Revision: 497
URL: http://svn.debian.org/wsvn/pkg-lustre/?sc=1&rev=497
Log:
update patch
Modified:
trunk/debian/changelog
trunk/debian/patches/bug_15949_mds.body_capacity.dpatch
Modified: trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-lustre/trunk/debian/changelog?rev=497&op=diff
==============================================================================
--- trunk/debian/changelog (original)
+++ trunk/debian/changelog Mon Sep 15 19:41:20 2008
@@ -2,7 +2,7 @@
* Add patch from bugzilla to fix 101 Error msg. This issue
is only around if using 1.6.4.x servers and 1.6.5.x clients
- (Or vice versa)
+ (bug_15949_mds.body_capacity.dpatch)
* Added patch from bugzilla to prevent kernel oops when
ost disk is ~70% full. - Doesn't work yet
* Add patch to support patchless clients <=2.6.24
Modified: trunk/debian/patches/bug_15949_mds.body_capacity.dpatch
URL: http://svn.debian.org/wsvn/pkg-lustre/trunk/debian/patches/bug_15949_mds.body_capacity.dpatch?rev=497&op=diff
==============================================================================
--- trunk/debian/patches/bug_15949_mds.body_capacity.dpatch (original)
+++ trunk/debian/patches/bug_15949_mds.body_capacity.dpatch Mon Sep 15 19:41:20 2008
@@ -2,13 +2,13 @@
## bug_15949_mds.body_capacity.dpatch by Patrick Winnertz <winnie at debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
-## DP: Patch from bug 15949 (should be closed in 1.6.6)
+## DP: Patch from bug 15949 (is closed in 1.6.7)
@DPATCH@
-diff -u -p -r1.2 curproc.h
---- libcfs/include/libcfs/curproc.h 27 Jul 2008 21:22:56 -0000 1.2
-+++ libcfs/include/libcfs/curproc.h 1 Sep 2008 15:26:52 -0000
-@@ -70,10 +70,29 @@ char *cfs_curproc_comm(void);
+diff -u -p -r1.3.38.2 curproc.h
+--- lnet/include/libcfs/curproc.h 7 Aug 2008 09:50:04 -0000 1.3.38.2
++++ lnet/include/libcfs/curproc.h 11 Sep 2008 11:42:27 -0000
+@@ -70,10 +70,39 @@ char *cfs_curproc_comm(void);
*
* cfs_kernel_cap_t
*/
@@ -28,11 +28,21 @@
+#define CFS_CAP_SYS_BOOT 23
+#define CFS_CAP_SYS_RESOURCE 24
+
-+#define CFS_CAP_FS_MASK 0x1a0021f
++#define CFS_CAP_FS_MASK ((1 << CFS_CAP_CHOWN) | \
++ (1 << CFS_CAP_DAC_OVERRIDE) | \
++ (1 << CFS_CAP_DAC_READ_SEARCH) | \
++ (1 << CFS_CAP_FOWNER) | \
++ (1 << CFS_CAP_FSETID ) | \
++ (1 << CFS_CAP_LINUX_IMMUTABLE) | \
++ (1 << CFS_CAP_SYS_ADMIN) | \
++ (1 << CFS_CAP_SYS_BOOT) | \
++ (1 << CFS_CAP_SYS_RESOURCE))
+
+void cfs_cap_raise(cfs_cap_t cap);
+void cfs_cap_lower(cfs_cap_t cap);
+int cfs_cap_raised(cfs_cap_t cap);
++void cfs_kernel_cap_pack(cfs_kernel_cap_t kcap, cfs_cap_t *cap);
++void cfs_kernel_cap_unpack(cfs_kernel_cap_t *kcap, cfs_cap_t cap);
+cfs_cap_t cfs_curproc_cap_pack(void);
+void cfs_curproc_cap_unpack(cfs_cap_t cap);
+int cfs_capable(cfs_cap_t cap);
@@ -40,13 +50,9 @@
/* __LIBCFS_CURPROC_H__ */
#endif
/*
-Index: libcfs/include/libcfs/darwin/darwin-prim.h
-===================================================================
-RCS file: /cvsroot/cfs/libcfs/include/libcfs/darwin/darwin-prim.h,v
-retrieving revision 1.2
-diff -u -p -r1.2 darwin-prim.h
---- libcfs/include/libcfs/darwin/darwin-prim.h 27 Jul 2008 21:22:57 -0000 1.2
-+++ libcfs/include/libcfs/darwin/darwin-prim.h 1 Sep 2008 15:26:52 -0000
+diff -u -p -r1.6.12.2 darwin-prim.h
+--- lnet/include/libcfs/darwin/darwin-prim.h 7 Aug 2008 09:50:06 -0000 1.6.12.2
++++ lnet/include/libcfs/darwin/darwin-prim.h 11 Sep 2008 11:42:27 -0000
@@ -438,10 +438,6 @@ extern int is_suser(void);
#define lock_kernel() do {} while(0)
#define unlock_kernel() do {} while(0)
@@ -58,13 +64,9 @@
#define USERMODEHELPER(path, argv, envp) (0)
#define cfs_module(name, version, init, fini) \
-Index: libcfs/include/libcfs/darwin/libcfs.h
-===================================================================
-RCS file: /cvsroot/cfs/libcfs/include/libcfs/darwin/libcfs.h,v
-retrieving revision 1.2
-diff -u -p -r1.2 libcfs.h
---- libcfs/include/libcfs/darwin/libcfs.h 27 Jul 2008 21:22:57 -0000 1.2
-+++ libcfs/include/libcfs/darwin/libcfs.h 1 Sep 2008 15:26:52 -0000
+diff -u -p -r1.3.44.2 libcfs.h
+--- lnet/include/libcfs/darwin/libcfs.h 7 Aug 2008 09:50:08 -0000 1.3.44.2
++++ lnet/include/libcfs/darwin/libcfs.h 11 Sep 2008 11:42:27 -0000
@@ -203,7 +203,7 @@ __entry_nesting(&__cdd);
/*
* XNU has no capabilities
@@ -74,13 +76,9 @@
#ifdef __KERNEL__
enum {
-Index: libcfs/include/libcfs/winnt/winnt-prim.h
-===================================================================
-RCS file: /cvsroot/cfs/libcfs/include/libcfs/winnt/winnt-prim.h,v
-retrieving revision 1.2
-diff -u -p -r1.2 winnt-prim.h
---- libcfs/include/libcfs/winnt/winnt-prim.h 27 Jul 2008 21:22:59 -0000 1.2
-+++ libcfs/include/libcfs/winnt/winnt-prim.h 1 Sep 2008 15:26:52 -0000
+diff -u -p -r1.2.44.2 winnt-prim.h
+--- lnet/include/libcfs/winnt/winnt-prim.h 7 Aug 2008 09:50:11 -0000 1.2.44.2
++++ lnet/include/libcfs/winnt/winnt-prim.h 11 Sep 2008 11:42:27 -0000
@@ -709,11 +709,6 @@ libcfs_arch_cleanup(void);
#define lock_kernel() do {} while(0)
#define unlock_kernel() do {} while(0)
@@ -93,13 +91,9 @@
#define USERMODEHELPER(path, argv, envp) (0)
-Index: libcfs/libcfs/lwt.c
-===================================================================
-RCS file: /cvsroot/cfs/libcfs/libcfs/lwt.c,v
-retrieving revision 1.3
-diff -u -p -r1.3 lwt.c
---- libcfs/libcfs/lwt.c 27 Jul 2008 21:23:00 -0000 1.3
-+++ libcfs/libcfs/lwt.c 1 Sep 2008 15:26:52 -0000
+diff -u -p -r1.8.18.2 lwt.c
+--- lnet/libcfs/lwt.c 7 Aug 2008 09:50:56 -0000 1.8.18.2
++++ lnet/libcfs/lwt.c 11 Sep 2008 11:42:28 -0000
@@ -86,7 +86,7 @@ lwt_lookup_string (int *size, char *knl_
* trying to determine the string length, so we're trusting our
* caller... */
@@ -127,14 +121,10 @@
return (-EPERM);
*ncpu = num_online_cpus();
-Index: libcfs/libcfs/darwin/darwin-curproc.c
-===================================================================
-RCS file: /cvsroot/cfs/libcfs/libcfs/darwin/darwin-curproc.c,v
-retrieving revision 1.3
-diff -u -p -r1.3 darwin-curproc.c
---- libcfs/libcfs/darwin/darwin-curproc.c 27 Jul 2008 21:23:01 -0000 1.3
-+++ libcfs/libcfs/darwin/darwin-curproc.c 1 Sep 2008 15:26:52 -0000
-@@ -163,16 +163,25 @@ char *cfs_curproc_comm(void)
+diff -u -p -r1.3.44.2 darwin-curproc.c
+--- lnet/libcfs/darwin/darwin-curproc.c 7 Aug 2008 09:51:02 -0000 1.3.44.2
++++ lnet/libcfs/darwin/darwin-curproc.c 11 Sep 2008 11:42:28 -0000
+@@ -164,17 +164,28 @@ char *cfs_curproc_comm(void)
#endif
}
@@ -147,31 +137,30 @@
+ return 1;
+}
+
++void cfs_kernel_cap_pack(kernel_cap_t *kcap, cfs_cap_t cap) {}
++void cfs_kernel_cap_unpack(kernel_cap_t *kcap, cfs_cap_t cap) {}
++
+cfs_cap_t cfs_curproc_cap_pack(void) {
return -1;
}
-void cfs_curproc_cap_set(cfs_kernel_cap_t cap)
--{
++void cfs_curproc_cap_unpack(cfs_cap_t cap) {}
++
++int cfs_capable(cfs_cap_t cap)
+ {
- return;
-+void cfs_curproc_cap_unpack(cfs_cap_t cap) {
- }
-
-+int cfs_capable(cfs_cap_t cap)
-+{
+ return cap == CFS_CAP_SYS_BOOT ? is_suser(): is_suser1();
-+}
-
+ }
+
+-
/*
* Local variables:
-Index: libcfs/libcfs/linux/linux-curproc.c
-===================================================================
-RCS file: /cvsroot/cfs/libcfs/libcfs/linux/linux-curproc.c,v
-retrieving revision 1.3
-diff -u -p -r1.3 linux-curproc.c
---- libcfs/libcfs/linux/linux-curproc.c 27 Jul 2008 21:23:02 -0000 1.3
-+++ libcfs/libcfs/linux/linux-curproc.c 1 Sep 2008 15:26:52 -0000
-@@ -120,14 +120,48 @@ char *cfs_curproc_comm(void)
+ * c-indentation-style: "K&R"
+diff -u -p -r1.3.44.2 linux-curproc.c
+--- lnet/libcfs/linux/linux-curproc.c 7 Aug 2008 09:51:04 -0000 1.3.44.2
++++ lnet/libcfs/linux/linux-curproc.c 11 Sep 2008 11:42:28 -0000
+@@ -121,14 +121,63 @@ char *cfs_curproc_comm(void)
return current->comm;
}
@@ -186,8 +175,7 @@
+}
+
+void cfs_cap_lower(cfs_cap_t cap)
- {
-- return current->cap_effective;
++{
+ cap_lower(cfs_current()->cap_effective, cfs_cap_unpack(cap));
+}
+
@@ -196,24 +184,40 @@
+ return cap_raised(cfs_current()->cap_effective, cfs_cap_unpack(cap));
+}
+
-+cfs_cap_t cfs_curproc_cap_pack(void) {
++void cfs_kernel_cap_pack(cfs_kernel_cap_t kcap, cfs_cap_t *cap)
++{
+#if _LINUX_CAPABILITY_VERSION == 0x19980330
-+ return cfs_cap_pack(current->cap_effective);
++ *cap = cfs_cap_pack(kcap);
+#elif _LINUX_CAPABILITY_VERSION == 0x20071026
-+ return cfs_cap_pack(current->cap_effective[0]);
++ *cap = cfs_cap_pack(kcap[0]);
+#else
+ #error "need correct _LINUX_CAPABILITY_VERSION "
+#endif
+}
+
-+void cfs_curproc_cap_unpack(cfs_cap_t cap) {
++void cfs_kernel_cap_unpack(cfs_kernel_cap_t *kcap, cfs_cap_t cap)
++{
+#if _LINUX_CAPABILITY_VERSION == 0x19980330
-+ current->cap_effective = cfs_cap_unpack(cap);
++ *kcap = cfs_cap_unpack(cap);
+#elif _LINUX_CAPABILITY_VERSION == 0x20071026
-+ current->cap_effective[0] = cfs_cap_unpack(cap);
++ (*kcap)[0] = cfs_cap_unpack(cap);
+#else
+ #error "need correct _LINUX_CAPABILITY_VERSION "
+#endif
++
++}
++
++cfs_cap_t cfs_curproc_cap_pack(void)
++{
++ cfs_cap_t cap;
++ cfs_kernel_cap_pack(current->cap_effective, &cap);
++ return cap;
++}
++
++void cfs_curproc_cap_unpack(cfs_cap_t cap)
+ {
+- return current->cap_effective;
++ cfs_kernel_cap_unpack(¤t->cap_effective, cap);
}
-void cfs_curproc_cap_set(cfs_kernel_cap_t cap)
@@ -224,7 +228,7 @@
}
EXPORT_SYMBOL(cfs_curproc_uid);
-@@ -140,8 +174,12 @@ EXPORT_SYMBOL(cfs_curproc_comm);
+@@ -141,8 +190,14 @@ EXPORT_SYMBOL(cfs_curproc_comm);
EXPORT_SYMBOL(cfs_curproc_groups_nr);
EXPORT_SYMBOL(cfs_curproc_groups_dump);
EXPORT_SYMBOL(cfs_curproc_is_in_groups);
@@ -233,20 +237,24 @@
+EXPORT_SYMBOL(cfs_cap_raise);
+EXPORT_SYMBOL(cfs_cap_lower);
+EXPORT_SYMBOL(cfs_cap_raised);
++EXPORT_SYMBOL(cfs_kernel_cap_pack);
++EXPORT_SYMBOL(cfs_kernel_cap_unpack);
+EXPORT_SYMBOL(cfs_curproc_cap_pack);
+EXPORT_SYMBOL(cfs_curproc_cap_unpack);
+EXPORT_SYMBOL(cfs_capable);
/*
* Local variables:
-Index: libcfs/libcfs/linux/linux-module.c
-===================================================================
-RCS file: /cvsroot/cfs/libcfs/libcfs/linux/linux-module.c,v
-retrieving revision 1.3
-diff -u -p -r1.3 linux-module.c
---- libcfs/libcfs/linux/linux-module.c 27 Jul 2008 21:23:02 -0000 1.3
-+++ libcfs/libcfs/linux/linux-module.c 1 Sep 2008 15:26:52 -0000
-@@ -157,7 +157,7 @@ libcfs_ioctl(struct inode *inode, struct
+diff -u -p -r1.3.44.2 linux-module.c
+--- lnet/libcfs/linux/linux-module.c 7 Aug 2008 09:51:06 -0000 1.3.44.2
++++ lnet/libcfs/linux/linux-module.c 11 Sep 2008 11:42:28 -0000
+@@ -153,12 +153,12 @@ libcfs_ioctl(struct inode *inode, struct
+ /* Handle platform-dependent IOC requests */
+ switch (cmd) {
+ case IOC_LIBCFS_PANIC:
+- if (!capable (CAP_SYS_BOOT))
++ if (!cfs_capable(CFS_CAP_SYS_BOOT))
+ return (-EPERM);
panic("debugctl-invoked panic");
return (0);
case IOC_LIBCFS_MEMHOG:
@@ -255,14 +263,10 @@
return -EPERM;
/* go thought */
}
-Index: libcfs/libcfs/winnt/winnt-curproc.c
-===================================================================
-RCS file: /cvsroot/cfs/libcfs/libcfs/winnt/winnt-curproc.c,v
-retrieving revision 1.3
-diff -u -p -r1.3 winnt-curproc.c
---- libcfs/libcfs/winnt/winnt-curproc.c 27 Jul 2008 21:23:03 -0000 1.3
-+++ libcfs/libcfs/winnt/winnt-curproc.c 1 Sep 2008 15:26:53 -0000
-@@ -106,16 +106,33 @@ char *cfs_curproc_comm(void)
+diff -u -p -r1.2.44.2 winnt-curproc.c
+--- lnet/libcfs/winnt/winnt-curproc.c 7 Aug 2008 09:51:10 -0000 1.2.44.2
++++ lnet/libcfs/winnt/winnt-curproc.c 11 Sep 2008 11:42:28 -0000
+@@ -107,16 +107,45 @@ char *cfs_curproc_comm(void)
return this_task.comm;
}
@@ -285,12 +289,24 @@
+ return this_task.cap_effective & (1 << cap);
+}
+
++void cfs_kernel_cap_pack(cfs_kernel_cap_t kcap, cfs_cap_t *cap)
++{
++ *cap = kcap;
++}
++
++void cfs_kernel_cap_unpack(cfs_kernel_cap_t *kcap, cfs_cap_t cap)
++{
++ *kcap = cap;
++}
++
+cfs_cap_t cfs_curproc_cap_pack(void) {
-+ return this_task.cap_effective;
++ cfs_cap_t cap;
++ cfs_kernel_cap_pack(this_task.cap_effective, &cap);
++ return cap;
+}
+
+void cfs_curproc_cap_unpack(cfs_cap_t cap) {
-+ this_task.cap_effective = cap;
++ cfs_kernel_cap_unpack(&this_task.cap_effective, cap);
+}
+
+int cfs_capable(cfs_cap_t cap)
@@ -300,7 +316,7 @@
/*
* Implementation of linux task management routines
-@@ -468,5 +485,9 @@ EXPORT_SYMBOL(cfs_curproc_comm);
+@@ -469,5 +498,11 @@ EXPORT_SYMBOL(cfs_curproc_comm);
EXPORT_SYMBOL(cfs_curproc_groups_nr);
EXPORT_SYMBOL(cfs_curproc_groups_dump);
EXPORT_SYMBOL(cfs_curproc_is_in_groups);
@@ -309,17 +325,24 @@
+EXPORT_SYMBOL(cfs_cap_raise);
+EXPORT_SYMBOL(cfs_cap_lower);
+EXPORT_SYMBOL(cfs_cap_raised);
++EXPORT_SYMBOL(cfs_kernel_cap_pack);
++EXPORT_SYMBOL(cfs_kernel_cap_unpack);
+EXPORT_SYMBOL(cfs_curproc_cap_pack);
+EXPORT_SYMBOL(cfs_curproc_cap_unpack);
+EXPORT_SYMBOL(cfs_capable);
-Index: libcfs/libcfs/winnt/winnt-module.c
-===================================================================
-RCS file: /cvsroot/cfs/libcfs/libcfs/winnt/winnt-module.c,v
-retrieving revision 1.3
-diff -u -p -r1.3 winnt-module.c
---- libcfs/libcfs/winnt/winnt-module.c 27 Jul 2008 21:23:04 -0000 1.3
-+++ libcfs/libcfs/winnt/winnt-module.c 1 Sep 2008 15:26:53 -0000
-@@ -145,7 +145,7 @@ libcfs_ioctl(cfs_file_t * file, unsigned
+diff -u -p -r1.2.44.2 winnt-module.c
+--- lnet/libcfs/winnt/winnt-module.c 7 Aug 2008 09:51:10 -0000 1.2.44.2
++++ lnet/libcfs/winnt/winnt-module.c 11 Sep 2008 11:42:28 -0000
+@@ -138,7 +138,7 @@ libcfs_ioctl(cfs_file_t * file, unsigned
+ /* Handle platform-dependent IOC requests */
+ switch (cmd) {
+ case IOC_LIBCFS_PANIC:
+- if (!capable (CAP_SYS_BOOT))
++ if (!cfs_capable(CFS_CAP_SYS_BOOT))
+ return (-EPERM);
+ CERROR(("debugctl-invoked panic"));
+ KeBugCheckEx('LUFS', (ULONG_PTR)libcfs_ioctl, (ULONG_PTR)NULL, (ULONG_PTR)NULL, (ULONG_PTR)NULL);
+@@ -146,7 +146,7 @@ libcfs_ioctl(cfs_file_t * file, unsigned
return (0);
case IOC_LIBCFS_MEMHOG:
@@ -328,66 +351,19 @@
return -EPERM;
break;
}
-Index: lustre/cmm/mdc_object.c
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/cmm/mdc_object.c,v
-retrieving revision 1.5
-diff -u -p -r1.5 mdc_object.c
---- lustre/cmm/mdc_object.c 27 Jul 2008 21:23:48 -0000 1.5
-+++ lustre/cmm/mdc_object.c 1 Sep 2008 15:26:53 -0000
-@@ -293,7 +293,7 @@ static int mdc_attr_set(const struct lu_
- } else {
- mci->mci_opdata.op_fsuid = la->la_uid;
- mci->mci_opdata.op_fsgid = la->la_gid;
-- mci->mci_opdata.op_cap = current->cap_effective;
-+ mci->mci_opdata.op_cap = cfs_curproc_cap_pack();
- mci->mci_opdata.op_suppgids[0] =
- mci->mci_opdata.op_suppgids[1] = -1;
- }
-@@ -319,7 +319,7 @@ static int mdc_object_create(const struc
- int rc, symlen;
- uid_t uid;
- gid_t gid;
-- __u32 cap;
-+ cfs_cap_t cap;
- ENTRY;
-
- LASSERT(S_ISDIR(la->la_mode));
-@@ -415,7 +415,7 @@ static int mdc_ref_add(const struct lu_e
- } else {
- mci->mci_opdata.op_fsuid = la->la_uid;
- mci->mci_opdata.op_fsgid = la->la_gid;
-- mci->mci_opdata.op_cap = current->cap_effective;
-+ mci->mci_opdata.op_cap = cfs_curproc_cap_pack();
- mci->mci_opdata.op_suppgids[0] =
- mci->mci_opdata.op_suppgids[1] = -1;
- }
-@@ -459,7 +459,7 @@ static int mdc_ref_del(const struct lu_e
- } else {
- mci->mci_opdata.op_fsuid = la->la_uid;
- mci->mci_opdata.op_fsgid = la->la_gid;
-- mci->mci_opdata.op_cap = current->cap_effective;
-+ mci->mci_opdata.op_cap = cfs_curproc_cap_pack();
- mci->mci_opdata.op_suppgids[0] = -1;
- }
-
-@@ -535,7 +535,7 @@ static int mdc_rename_tgt(const struct l
- } else {
- mci->mci_opdata.op_fsuid = la->la_uid;
- mci->mci_opdata.op_fsgid = la->la_gid;
-- mci->mci_opdata.op_cap = current->cap_effective;
-+ mci->mci_opdata.op_cap = cfs_curproc_cap_pack();
- mci->mci_opdata.op_suppgids[0] =
- mci->mci_opdata.op_suppgids[1] = -1;
- }
-Index: lustre/include/liblustre.h
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/include/liblustre.h,v
-retrieving revision 1.66
-diff -u -p -r1.66 liblustre.h
---- lustre/include/liblustre.h 27 Jul 2008 21:23:57 -0000 1.66
-+++ lustre/include/liblustre.h 1 Sep 2008 15:26:53 -0000
-@@ -589,13 +589,6 @@ typedef struct task_struct cfs_task_t;
+diff -u -p -r1.43.6.26 liblustre.h
+--- lustre/include/liblustre.h 7 Aug 2008 09:51:37 -0000 1.43.6.26
++++ lustre/include/liblustre.h 11 Sep 2008 11:42:28 -0000
+@@ -597,7 +597,7 @@ struct task_struct {
+ int max_groups;
+ int ngroups;
+ gid_t *groups;
+- __u32 cap_effective;
++ cfs_cap_t cap_effective;
+ };
+
+ typedef struct task_struct cfs_task_t;
+@@ -607,13 +607,6 @@ typedef struct task_struct cfs_task_t;
extern struct task_struct *current;
int in_group_p(gid_t gid);
@@ -401,7 +377,7 @@
#define set_current_state(foo) do { current->state = foo; } while (0)
-@@ -769,12 +762,6 @@ typedef enum {
+@@ -753,12 +746,6 @@ typedef enum {
CAP_SET=1
} cap_flag_value_t;
@@ -414,16 +390,12 @@
cap_t cap_get_proc(void);
int cap_get_flag(cap_t, cap_value_t, cap_flag_t, cap_flag_value_t *);
-Index: lustre/include/lustre_log.h
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/include/lustre_log.h,v
-retrieving revision 1.7
-diff -u -p -r1.7 lustre_log.h
---- lustre/include/lustre_log.h 27 Jul 2008 21:24:01 -0000 1.7
-+++ lustre/include/lustre_log.h 1 Sep 2008 15:26:53 -0000
-@@ -237,14 +237,6 @@ struct llog_ctxt {
- void *llog_proc_cb;
- };
+diff -u -p -r1.2.34.7 lustre_log.h
+--- lustre/include/lustre_log.h 5 Sep 2008 11:14:41 -0000 1.2.34.7
++++ lustre/include/lustre_log.h 11 Sep 2008 11:42:28 -0000
+@@ -331,14 +331,6 @@ extern int llog_recov_thread_start(struc
+ extern void llog_recov_thread_stop(struct llog_commit_master *lcm,
+ int force);
-#ifndef __KERNEL__
-
@@ -436,7 +408,7 @@
static inline void llog_gen_init(struct llog_ctxt *ctxt)
{
struct obd_device *obd = ctxt->loc_exp->exp_obd;
-@@ -392,8 +384,7 @@ static inline int llog_write_rec(struct
+@@ -442,8 +434,7 @@ static inline int llog_write_rec(struct
int numcookies, void *buf, int idx)
{
struct llog_operations *lop;
@@ -446,7 +418,7 @@
ENTRY;
rc = llog_handle2ops(handle, &lop);
-@@ -410,10 +401,12 @@ static inline int llog_write_rec(struct
+@@ -459,10 +450,12 @@ static inline int llog_write_rec(struct
buflen = rec->lrh_len;
LASSERT(size_round(buflen) == buflen);
@@ -462,7 +434,7 @@
RETURN(rc);
}
-@@ -509,8 +502,7 @@ static inline int llog_create(struct llo
+@@ -558,8 +551,7 @@ static inline int llog_create(struct llo
struct llog_logid *logid, char *name)
{
struct llog_operations *lop;
@@ -472,7 +444,7 @@
ENTRY;
rc = llog_obd2ops(ctxt, &lop);
-@@ -519,10 +511,12 @@ static inline int llog_create(struct llo
+@@ -568,10 +560,12 @@ static inline int llog_create(struct llo
if (lop->lop_create == NULL)
RETURN(-EOPNOTSUPP);
@@ -488,70 +460,22 @@
RETURN(rc);
}
-Index: lustre/include/md_object.h
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/include/md_object.h,v
-retrieving revision 1.8
-diff -u -p -r1.8 md_object.h
---- lustre/include/md_object.h 27 Jul 2008 21:24:04 -0000 1.8
-+++ lustre/include/md_object.h 1 Sep 2008 15:26:53 -0000
-@@ -81,7 +81,7 @@ struct md_ucred {
- __u32 mu_fsuid;
- __u32 mu_fsgid;
- __u32 mu_suppgids[2];
-- __u32 mu_cap;
-+ cfs_cap_t mu_cap;
- __u32 mu_umask;
- struct group_info *mu_ginfo;
- struct md_identity *mu_identity;
-Index: lustre/include/obd.h
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/include/obd.h,v
-retrieving revision 1.53
-diff -u -p -r1.53 obd.h
---- lustre/include/obd.h 27 Jul 2008 21:24:04 -0000 1.53
-+++ lustre/include/obd.h 1 Sep 2008 15:26:53 -0000
-@@ -1092,7 +1092,7 @@ struct md_op_data {
- __u32 op_suppgids[2];
- __u32 op_fsuid;
- __u32 op_fsgid;
-- __u32 op_cap;
-+ cfs_cap_t op_cap;
- void *op_data;
-
- /* iattr fields and blocks. */
-@@ -1397,7 +1397,7 @@ struct md_ops {
- int (*m_close)(struct obd_export *, struct md_op_data *,
- struct md_open_data *, struct ptlrpc_request **);
- int (*m_create)(struct obd_export *, struct md_op_data *,
-- const void *, int, int, __u32, __u32, __u32,
-+ const void *, int, int, __u32, __u32, cfs_cap_t,
- __u64, struct ptlrpc_request **);
- int (*m_done_writing)(struct obd_export *, struct md_op_data *,
- struct md_open_data *);
-Index: lustre/include/obd_class.h
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/include/obd_class.h,v
-retrieving revision 1.27
-diff -u -p -r1.27 obd_class.h
---- lustre/include/obd_class.h 27 Jul 2008 21:24:05 -0000 1.27
-+++ lustre/include/obd_class.h 1 Sep 2008 15:26:53 -0000
-@@ -1841,7 +1841,7 @@ static inline int md_close(struct obd_ex
-
- static inline int md_create(struct obd_export *exp, struct md_op_data *op_data,
- const void *data, int datalen, int mode, __u32 uid,
-- __u32 gid, __u32 cap_effective, __u64 rdev,
-+ __u32 gid, cfs_cap_t cap_effective, __u64 rdev,
- struct ptlrpc_request **request)
- {
- int rc;
-Index: lustre/include/darwin/lvfs.h
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/include/darwin/lvfs.h,v
-retrieving revision 1.3
-diff -u -p -r1.3 lvfs.h
---- lustre/include/darwin/lvfs.h 27 Jul 2008 21:24:11 -0000 1.3
-+++ lustre/include/darwin/lvfs.h 1 Sep 2008 15:26:53 -0000
+diff -u -p -r1.2.34.12 lustre_mds.h
+--- lustre/include/lustre_mds.h 7 Aug 2008 09:51:44 -0000 1.2.34.12
++++ lustre/include/lustre_mds.h 11 Sep 2008 11:42:28 -0000
+@@ -209,7 +209,8 @@ int mdc_readpage(struct obd_export *exp,
+ struct page *, struct ptlrpc_request **);
+ int mdc_create(struct obd_export *exp, struct mdc_op_data *op_data,
+ const void *data, int datalen, int mode, __u32 uid, __u32 gid,
+- __u32 cap_effective, __u64 rdev,struct ptlrpc_request **request);
++ cfs_cap_t cap_effective, __u64 rdev,
++ struct ptlrpc_request **request);
+ int mdc_unlink(struct obd_export *exp, struct mdc_op_data *data,
+ struct ptlrpc_request **request);
+ int mdc_link(struct obd_export *exp, struct mdc_op_data *data,
+diff -u -p -r1.2.34.2 lvfs.h
+--- lustre/include/darwin/lvfs.h 7 Aug 2008 09:51:58 -0000 1.2.34.2
++++ lustre/include/darwin/lvfs.h 11 Sep 2008 11:42:28 -0000
@@ -48,7 +48,7 @@
struct lvfs_ucred {
__u32 luc_fsuid;
@@ -561,30 +485,22 @@
__u32 luc_uid;
__u32 luc_umask;
};
-Index: lustre/include/linux/lvfs.h
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/include/linux/lvfs.h,v
-retrieving revision 1.35
-diff -u -p -r1.35 lvfs.h
---- lustre/include/linux/lvfs.h 27 Jul 2008 21:24:18 -0000 1.35
-+++ lustre/include/linux/lvfs.h 1 Sep 2008 15:26:53 -0000
-@@ -62,7 +62,7 @@ struct lvfs_ucred {
- __u32 luc_gid;
- __u32 luc_fsuid;
- __u32 luc_fsgid;
-- __u32 luc_cap;
-+ cfs_kernel_cap_t luc_cap;
- __u32 luc_umask;
- struct group_info *luc_ginfo;
- struct md_identity *luc_identity;
-Index: lustre/liblustre/lutil.c
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/liblustre/lutil.c,v
-retrieving revision 1.10
-diff -u -p -r1.10 lutil.c
---- lustre/liblustre/lutil.c 27 Jul 2008 21:24:37 -0000 1.10
-+++ lustre/liblustre/lutil.c 1 Sep 2008 15:26:54 -0000
-@@ -228,6 +228,34 @@ int liblustre_init_current(char *comm)
+diff -u -p -r1.29.18.4 lvfs.h
+--- lustre/include/linux/lvfs.h 7 Aug 2008 09:52:12 -0000 1.29.18.4
++++ lustre/include/linux/lvfs.h 11 Sep 2008 11:42:28 -0000
+@@ -64,7 +64,7 @@ struct lvfs_ucred {
+ struct upcall_cache_entry *luc_uce;
+ __u32 luc_fsuid;
+ __u32 luc_fsgid;
+- __u32 luc_cap;
++ cfs_kernel_cap_t luc_cap;
+ __u32 luc_suppgid1;
+ __u32 luc_suppgid2;
+ __u32 luc_umask;
+diff -u -p -r1.6.10.4 lutil.c
+--- lustre/liblustre/lutil.c 8 Sep 2008 06:51:28 -0000 1.6.10.4
++++ lustre/liblustre/lutil.c 11 Sep 2008 11:42:28 -0000
+@@ -227,6 +227,46 @@ int liblustre_init_current(char *comm)
return 0;
}
@@ -603,12 +519,24 @@
+ return current->cap_effective & (1 << cap);
+}
+
++void cfs_kernel_cap_pack(cfs_kernel_cap_t kcap, cfs_cap_t *cap)
++{
++ *cap = kcap;
++}
++
++void cfs_kernel_cap_unpack(cfs_kernel_cap_t *kcap, cfs_cap_t cap)
++{
++ *kcap = cap;
++}
++
+cfs_cap_t cfs_curproc_cap_pack(void) {
-+ return cfs_current()->cap_effective;
++ cfs_cap_t cap;
++ cfs_kernel_cap_pack(cfs_current()->cap_effective, &cap);
++ return cap;
+}
+
+void cfs_curproc_cap_unpack(cfs_cap_t cap) {
-+ cfs_current()->cap_effective = cap;
++ cfs_kernel_cap_unpack(&cfs_current()->cap_effective, cap);
+}
+
+int cfs_capable(cfs_cap_t cap)
@@ -619,13 +547,9 @@
int init_lib_portals()
{
int rc;
-Index: lustre/liblustre/super.c
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/liblustre/super.c,v
-retrieving revision 1.70
-diff -u -p -r1.70 super.c
---- lustre/liblustre/super.c 27 Jul 2008 21:24:39 -0000 1.70
-+++ lustre/liblustre/super.c 1 Sep 2008 15:26:54 -0000
+diff -u -p -r1.47.2.18 super.c
+--- lustre/liblustre/super.c 7 Aug 2008 09:52:46 -0000 1.47.2.18
++++ lustre/liblustre/super.c 11 Sep 2008 11:42:28 -0000
@@ -92,12 +92,12 @@ static int ll_permission(struct inode *i
if ((mask & (MAY_READ|MAY_WRITE)) ||
@@ -641,7 +565,7 @@
return 0;
}
-@@ -635,7 +635,7 @@ static int inode_setattr(struct inode *
+@@ -609,7 +609,7 @@ static int inode_setattr(struct inode *
st->st_ctime = attr->ia_ctime;
if (ia_valid & ATTR_MODE) {
st->st_mode = attr->ia_mode;
@@ -650,7 +574,7 @@
st->st_mode &= ~S_ISGID;
}
/* mark_inode_dirty(inode); */
-@@ -821,7 +821,7 @@ int llu_setattr_raw(struct inode *inode,
+@@ -735,7 +735,7 @@ int llu_setattr_raw(struct inode *inode,
} else {
/* from inode_change_ok() */
if (current->fsuid != st->st_uid &&
@@ -659,46 +583,46 @@
RETURN(-EPERM);
}
}
-@@ -979,10 +979,9 @@ static int llu_iop_symlink_raw(struct pn
- llu_prep_md_op_data(&op_data, dir, NULL, name, len, 0,
- LUSTRE_OPC_SYMLINK);
-
-- err = md_create(sbi->ll_md_exp, &op_data,
-- tgt, strlen(tgt) + 1, S_IFLNK | S_IRWXUGO,
-- current->fsuid, current->fsgid, current->cap_effective,
-- 0, &request);
-+ err = md_create(sbi->ll_md_exp, &op_data, tgt, strlen(tgt) + 1,
-+ S_IFLNK | S_IRWXUGO, current->fsuid, current->fsgid,
-+ cfs_curproc_cap_pack(), 0, &request);
+@@ -886,10 +886,9 @@ static int llu_iop_symlink_raw(struct pn
+ RETURN(err);
+
+ llu_prepare_mdc_op_data(&op_data, dir, NULL, name, len, 0);
+- err = mdc_create(sbi->ll_mdc_exp, &op_data,
+- tgt, strlen(tgt) + 1, S_IFLNK | S_IRWXUGO,
+- current->fsuid, current->fsgid, current->cap_effective,
+- 0, &request);
++ err = mdc_create(sbi->ll_mdc_exp, &op_data, tgt, strlen(tgt) + 1,
++ S_IFLNK | S_IRWXUGO, current->fsuid, current->fsgid,
++ cfs_curproc_cap_pack(), 0, &request);
ptlrpc_req_finished(request);
liblustre_wait_event(0);
RETURN(err);
-@@ -1107,7 +1106,7 @@ static int llu_iop_mknod_raw(struct pnod
-
- err = md_create(sbi->ll_md_exp, &op_data, NULL, 0, mode,
- current->fsuid, current->fsgid,
-- current->cap_effective, dev, &request);
-+ cfs_curproc_cap_pack(), dev, &request);
+@@ -1018,7 +1017,7 @@ static int llu_iop_mknod_raw(struct pnod
+ 0);
+ err = mdc_create(sbi->ll_mdc_exp, &op_data, NULL, 0, mode,
+ current->fsuid, current->fsgid,
+- current->cap_effective, dev, &request);
++ cfs_curproc_cap_pack(), dev, &request);
ptlrpc_req_finished(request);
break;
case S_IFDIR:
-@@ -1342,7 +1341,7 @@ static int llu_iop_mkdir_raw(struct pnod
-
- err = md_create(llu_i2sbi(dir)->ll_md_exp, &op_data, NULL, 0,
- mode | S_IFDIR, current->fsuid, current->fsgid,
-- current->cap_effective, 0, &request);
-+ cfs_curproc_cap_pack(), 0, &request);
+@@ -1246,9 +1245,9 @@ static int llu_iop_mkdir_raw(struct pnod
+ RETURN(err);
+
+ llu_prepare_mdc_op_data(&op_data, dir, NULL, name, len, 0);
+- err = mdc_create(llu_i2sbi(dir)->ll_mdc_exp, &op_data, NULL, 0, mode | S_IFDIR,
+- current->fsuid, current->fsgid, current->cap_effective,
+- 0, &request);
++ err = mdc_create(llu_i2sbi(dir)->ll_mdc_exp, &op_data, NULL, 0,
++ mode | S_IFDIR, current->fsuid, current->fsgid,
++ cfs_curproc_cap_pack(), 0, &request);
ptlrpc_req_finished(request);
liblustre_wait_event(0);
RETURN(err);
-Index: lustre/llite/dir.c
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/llite/dir.c,v
-retrieving revision 1.112
-diff -u -p -r1.112 dir.c
---- lustre/llite/dir.c 17 Jul 2008 17:35:03 -0000 1.112
-+++ lustre/llite/dir.c 1 Sep 2008 15:26:54 -0000
-@@ -937,7 +937,7 @@ static int ll_dir_ioctl(struct inode *in
+diff -u -p -r1.91.6.23 dir.c
+--- lustre/llite/dir.c 3 Sep 2008 09:11:40 -0000 1.91.6.23
++++ lustre/llite/dir.c 11 Sep 2008 11:42:28 -0000
+@@ -876,7 +876,7 @@ static int ll_dir_ioctl(struct inode *in
struct obd_quotactl *oqctl;
int rc, error = 0;
@@ -707,7 +631,7 @@
RETURN(-EPERM);
OBD_ALLOC_PTR(oqctl);
-@@ -961,7 +961,7 @@ static int ll_dir_ioctl(struct inode *in
+@@ -900,7 +900,7 @@ static int ll_dir_ioctl(struct inode *in
struct if_quotacheck *check;
int rc;
@@ -716,7 +640,7 @@
RETURN(-EPERM);
OBD_ALLOC_PTR(check);
-@@ -1016,13 +1016,13 @@ static int ll_dir_ioctl(struct inode *in
+@@ -956,13 +956,13 @@ static int ll_dir_ioctl(struct inode *in
case Q_QUOTAOFF:
case Q_SETQUOTA:
case Q_SETINFO:
@@ -732,23 +656,10 @@
GOTO(out_quotactl, rc = -EPERM);
/* XXX: dqb_valid is borrowed as a flag to mark that
-Index: lustre/llite/file.c
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/llite/file.c,v
-retrieving revision 1.254
-diff -u -p -r1.254 file.c
---- lustre/llite/file.c 27 Jul 2008 21:24:44 -0000 1.254
-+++ lustre/llite/file.c 1 Sep 2008 15:26:54 -0000
-@@ -751,7 +751,7 @@ static inline void ll_remove_suid(struct
-
- /* was any of the uid bits set? */
- mode &= inode->i_mode;
-- if (mode && !capable(CAP_FSETID)) {
-+ if (mode && !cfs_capable(CFS_CAP_FSETID)) {
- inode->i_mode &= ~mode;
- // XXX careful here - we cannot change the size
- }
-@@ -1987,7 +1987,7 @@ static int ll_lov_recreate_obj(struct in
+diff -u -p -r1.218.12.60 file.c
+--- lustre/llite/file.c 10 Sep 2008 01:56:34 -0000 1.218.12.60
++++ lustre/llite/file.c 11 Sep 2008 11:42:28 -0000
+@@ -1921,7 +1921,7 @@ static int ll_lov_recreate_obj(struct in
struct lov_stripe_md *lsm, *lsm2;
ENTRY;
@@ -757,7 +668,7 @@
RETURN(-EPERM);
rc = copy_from_user(&ucreatp, (struct ll_recreate_obj *)arg,
-@@ -2187,7 +2187,7 @@ static int ll_lov_setea(struct inode *in
+@@ -2134,7 +2134,7 @@ static int ll_lov_setea(struct inode *in
int rc;
ENTRY;
@@ -766,7 +677,7 @@
RETURN(-EPERM);
OBD_ALLOC(lump, lum_size);
-@@ -3103,10 +3103,10 @@ check_groups:
+@@ -3146,10 +3146,10 @@ check_groups:
check_capabilities:
if (!(mask & MAY_EXEC) ||
(inode->i_mode & S_IXUGO) || S_ISDIR(inode->i_mode))
@@ -778,15 +689,11 @@
+ if (cfs_capable(CFS_CAP_DAC_READ_SEARCH) && ((mask == MAY_READ) ||
(S_ISDIR(inode->i_mode) && !(mask & MAY_WRITE))))
return 0;
-
-Index: lustre/llite/llite_lib.c
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/llite/llite_lib.c,v
-retrieving revision 1.177
-diff -u -p -r1.177 llite_lib.c
---- lustre/llite/llite_lib.c 27 Jul 2008 21:24:46 -0000 1.177
-+++ lustre/llite/llite_lib.c 1 Sep 2008 15:26:54 -0000
-@@ -1426,7 +1426,8 @@ int ll_setattr_raw(struct inode *inode,
+
+diff -u -p -r1.134.2.57 llite_lib.c
+--- lustre/llite/llite_lib.c 6 Sep 2008 11:45:09 -0000 1.134.2.57
++++ lustre/llite/llite_lib.c 11 Sep 2008 11:42:28 -0000
+@@ -1444,7 +1444,8 @@ int ll_setattr_raw(struct inode *inode,
/* POSIX: check before ATTR_*TIME_SET set (from inode_change_ok) */
if (ia_valid & (ATTR_MTIME_SET | ATTR_ATIME_SET)) {
@@ -796,48 +703,31 @@
RETURN(-EPERM);
}
-@@ -2312,7 +2313,7 @@ struct md_op_data * ll_prep_md_op_data(s
- op_data->op_mod_time = cfs_time_current_sec();
- op_data->op_fsuid = current->fsuid;
- op_data->op_fsgid = current->fsgid;
-- op_data->op_cap = current->cap_effective;
-+ op_data->op_cap = cfs_curproc_cap_pack();
- op_data->op_bias = MDS_CHECK_SPLIT;
- op_data->op_opc = opc;
- op_data->op_mds = 0;
-Index: lustre/llite/namei.c
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/llite/namei.c,v
-retrieving revision 1.241
-diff -u -p -r1.241 namei.c
---- lustre/llite/namei.c 27 Jul 2008 21:24:48 -0000 1.241
-+++ lustre/llite/namei.c 1 Sep 2008 15:26:55 -0000
-@@ -841,7 +841,7 @@ static int ll_new_node(struct inode *dir
-
- err = md_create(sbi->ll_md_exp, op_data, tgt, tgt_len, mode,
- current->fsuid, current->fsgid,
-- current->cap_effective, rdev, &request);
-+ cfs_curproc_cap_pack(), rdev, &request);
- ll_finish_md_op_data(op_data);
+diff -u -p -r1.229.2.14 namei.c
+--- lustre/llite/namei.c 8 Sep 2008 08:57:42 -0000 1.229.2.14
++++ lustre/llite/namei.c 11 Sep 2008 11:42:28 -0000
+@@ -901,7 +901,7 @@ static int ll_new_node(struct inode *dir
+
+ err = mdc_create(sbi->ll_mdc_exp, &op_data, tgt, tgt_len,
+ mode, current->fsuid, current->fsgid,
+- current->cap_effective, rdev, &request);
++ cfs_curproc_cap_pack(), rdev, &request);
if (err)
GOTO(err_exit, err);
-Index: lustre/llite/rw.c
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/llite/rw.c,v
-retrieving revision 1.170
-diff -u -p -r1.170 rw.c
---- lustre/llite/rw.c 27 Jul 2008 21:24:49 -0000 1.170
-+++ lustre/llite/rw.c 1 Sep 2008 15:26:55 -0000
-@@ -868,7 +868,7 @@ int ll_commit_write(struct file *file, s
+
+diff -u -p -r1.145.16.34 rw.c
+--- lustre/llite/rw.c 7 Aug 2008 09:53:04 -0000 1.145.16.34
++++ lustre/llite/rw.c 11 Sep 2008 11:42:28 -0000
+@@ -843,7 +843,7 @@ int ll_commit_write(struct file *file, s
if (exp == NULL)
RETURN(-EINVAL);
- llap->llap_ignore_quota = capable(CAP_SYS_RESOURCE);
+ llap->llap_ignore_quota = cfs_capable(CFS_CAP_SYS_RESOURCE);
- /*
- * queue a write for some time in the future the first time we
-@@ -2059,7 +2059,7 @@ static int ll_file_oig_pages(struct inod
+ /* queue a write for some time in the future the first time we
+ * dirty the page */
+@@ -2038,7 +2038,7 @@ static int ll_file_oig_pages(struct inod
if (rc)
RETURN(rc);
brw_flags = OBD_BRW_SRVLOCK;
@@ -846,14 +736,10 @@
brw_flags |= OBD_BRW_NOQUOTA;
for (i = 0; i < numpages; i++) {
-Index: lustre/llite/xattr.c
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/llite/xattr.c,v
-retrieving revision 1.10
-diff -u -p -r1.10 xattr.c
---- lustre/llite/xattr.c 27 Jul 2008 21:24:52 -0000 1.10
-+++ lustre/llite/xattr.c 1 Sep 2008 15:26:55 -0000
-@@ -101,7 +101,7 @@ int xattr_type_filter(struct ll_sb_info
+diff -u -p -r1.2.34.10 xattr.c
+--- lustre/llite/xattr.c 7 Aug 2008 09:53:11 -0000 1.2.34.10
++++ lustre/llite/xattr.c 11 Sep 2008 11:42:28 -0000
+@@ -112,7 +112,7 @@ int xattr_type_filter(struct ll_sb_info
if (xattr_type == XATTR_USER_T && !(sbi->ll_flags & LL_SBI_USER_XATTR))
return -EOPNOTSUPP;
@@ -862,392 +748,243 @@
return -EPERM;
if (xattr_type == XATTR_OTHER_T)
return -EOPNOTSUPP;
-Index: lustre/lmv/lmv_obd.c
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/lmv/lmv_obd.c,v
-retrieving revision 1.120
-diff -u -p -r1.120 lmv_obd.c
---- lustre/lmv/lmv_obd.c 27 Jul 2008 21:24:56 -0000 1.120
-+++ lustre/lmv/lmv_obd.c 1 Sep 2008 15:26:55 -0000
-@@ -1379,7 +1379,7 @@ cleanup:
-
- int lmv_create(struct obd_export *exp, struct md_op_data *op_data,
- const void *data, int datalen, int mode, __u32 uid,
-- __u32 gid, __u32 cap_effective, __u64 rdev,
-+ __u32 gid, cfs_cap_t cap_effective, __u64 rdev,
- struct ptlrpc_request **request)
- {
- struct obd_device *obd = exp->exp_obd;
-@@ -1898,7 +1898,7 @@ repeat:
-
- op_data->op_fsuid = current->fsuid;
- op_data->op_fsgid = current->fsgid;
-- op_data->op_cap = current->cap_effective;
-+ op_data->op_cap = cfs_curproc_cap_pack();
-
- tgt_exp = lmv->tgts[mds].ltd_exp;
- if (op_data->op_namelen) {
-@@ -2022,7 +2022,7 @@ repeat:
- request:
- op_data->op_fsuid = current->fsuid;
- op_data->op_fsgid = current->fsgid;
-- op_data->op_cap = current->cap_effective;
-+ op_data->op_cap = cfs_curproc_cap_pack();
-
- src_exp = lmv_get_export(lmv, mds1);
- tgt_exp = lmv_get_export(lmv, mds2);
-@@ -2469,7 +2469,7 @@ repeat:
-
- op_data->op_fsuid = current->fsuid;
- op_data->op_fsgid = current->fsgid;
-- op_data->op_cap = current->cap_effective;
-+ op_data->op_cap = cfs_curproc_cap_pack();
-
- /* If child's fid is given, cancel unused locks for it if it is from
- * another export than parent. */
-Index: lustre/lvfs/fsfilt_ext3.c
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/lvfs/fsfilt_ext3.c,v
-retrieving revision 1.71
-diff -u -p -r1.71 fsfilt_ext3.c
---- lustre/lvfs/fsfilt_ext3.c 27 Jul 2008 21:25:04 -0000 1.71
-+++ lustre/lvfs/fsfilt_ext3.c 1 Sep 2008 15:26:55 -0000
-@@ -523,7 +523,8 @@ static int fsfilt_ext3_setattr(struct de
- if (iattr->ia_valid & ATTR_MODE) {
- inode->i_mode = iattr->ia_mode;
-
-- if (!in_group_p(inode->i_gid) && !capable(CAP_FSETID))
-+ if (!in_group_p(inode->i_gid) &&
-+ !cfs_capable(CFS_CAP_FSETID))
- inode->i_mode &= ~S_ISGID;
- }
-
-Index: lustre/mdc/mdc_internal.h
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/mdc/mdc_internal.h,v
-retrieving revision 1.29
-diff -u -p -r1.29 mdc_internal.h
---- lustre/mdc/mdc_internal.h 27 Jul 2008 21:25:09 -0000 1.29
-+++ lustre/mdc/mdc_internal.h 1 Sep 2008 15:26:55 -0000
-@@ -64,7 +64,7 @@ void mdc_setattr_pack(struct ptlrpc_requ
- void *ea, int ealen, void *ea2, int ea2len);
- void mdc_create_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
- const void *data, int datalen, __u32 mode, __u32 uid,
-- __u32 gid, __u32 cap_effective, __u64 rdev);
-+ __u32 gid, cfs_cap_t capability, __u64 rdev);
- void mdc_open_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
- __u32 mode, __u64 rdev, __u32 flags, const void *data,
- int datalen);
-@@ -144,7 +144,8 @@ void mdc_commit_delayed(struct ptlrpc_re
-
- int mdc_create(struct obd_export *exp, struct md_op_data *op_data,
- const void *data, int datalen, int mode, __u32 uid, __u32 gid,
-- __u32 cap_effective, __u64 rdev, struct ptlrpc_request **request);
-+ cfs_cap_t capability, __u64 rdev,
-+ struct ptlrpc_request **request);
- int mdc_link(struct obd_export *exp, struct md_op_data *op_data,
- struct ptlrpc_request **request);
- int mdc_rename(struct obd_export *exp, struct md_op_data *op_data,
-Index: lustre/mdc/mdc_lib.c
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/mdc/mdc_lib.c,v
-retrieving revision 1.35
-diff -u -p -r1.35 mdc_lib.c
---- lustre/mdc/mdc_lib.c 27 Jul 2008 21:25:09 -0000 1.35
-+++ lustre/mdc/mdc_lib.c 1 Sep 2008 15:26:55 -0000
-@@ -59,7 +59,7 @@ static void __mdc_pack_body(struct mdt_b
- b->gid = current->gid;
+diff -u -p -r1.17.34.4 mdc_internal.h
+--- lustre/mdc/mdc_internal.h 7 Aug 2008 09:53:39 -0000 1.17.34.4
++++ lustre/mdc/mdc_internal.h 11 Sep 2008 11:42:28 -0000
+@@ -60,7 +60,7 @@ void mdc_setattr_pack(struct ptlrpc_requ
+ void *ea2, int ea2len);
+ void mdc_create_pack(struct ptlrpc_request *req, int offset,
+ struct mdc_op_data *op_data, const void *data, int datalen,
+- __u32 mode, __u32 uid, __u32 gid, __u32 cap_effective,
++ __u32 mode, __u32 uid, __u32 gid, cfs_cap_t cap_effective,
+ __u64 rdev);
+ void mdc_open_pack(struct ptlrpc_request *req, int offset,
+ struct mdc_op_data *op_data, __u32 mode, __u64 rdev,
+diff -u -p -r1.23.34.11 mdc_lib.c
+--- lustre/mdc/mdc_lib.c 7 Aug 2008 09:53:41 -0000 1.23.34.11
++++ lustre/mdc/mdc_lib.c 11 Sep 2008 11:42:28 -0000
+@@ -58,7 +58,7 @@ void mdc_readdir_pack(struct ptlrpc_requ
+ b = lustre_msg_buf(req->rq_reqmsg, offset, sizeof(*b));
b->fsuid = current->fsuid;
b->fsgid = current->fsgid;
- b->capability = current->cap_effective;
+ b->capability = cfs_curproc_cap_pack();
- }
-
- void mdc_pack_capa(struct ptlrpc_request *req, const struct req_msg_field *field,
-@@ -128,7 +128,7 @@ void mdc_readdir_pack(struct ptlrpc_requ
+ b->fid1 = *fid;
+ b->size = pg_off; /* !! */
+ b->suppgid = -1;
+@@ -71,7 +71,7 @@ static void mdc_pack_body(struct mds_bod
+
+ b->fsuid = current->fsuid;
+ b->fsgid = current->fsgid;
+- b->capability = current->cap_effective;
++ b->capability = cfs_curproc_cap_pack();
+ }
+
+ void mdc_pack_req_body(struct ptlrpc_request *req, int offset,
+@@ -90,7 +90,7 @@ void mdc_pack_req_body(struct ptlrpc_req
/* packing of MDS records */
- void mdc_create_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
- const void *data, int datalen, __u32 mode,
-- __u32 uid, __u32 gid, __u32 cap_effective, __u64 rdev)
-+ __u32 uid, __u32 gid, cfs_cap_t cap_effective, __u64 rdev)
- {
- struct mdt_rec_create *rec;
- char *tmp;
-@@ -218,7 +218,7 @@ void mdc_open_pack(struct ptlrpc_request
- rec->cr_opcode = REINT_OPEN;
- rec->cr_fsuid = current->fsuid;
- rec->cr_fsgid = current->fsgid;
-- rec->cr_cap = current->cap_effective;
-+ rec->cr_cap = cfs_curproc_cap_pack();
- if (op_data != NULL) {
- rec->cr_fid1 = op_data->op_fid1;
- rec->cr_fid2 = op_data->op_fid2;
-@@ -298,7 +298,7 @@ static void mdc_setattr_pack_rec(struct
- rec->sa_opcode = REINT_SETATTR;
- rec->sa_fsuid = current->fsuid;
- rec->sa_fsgid = current->fsgid;
-- rec->sa_cap = current->cap_effective;
-+ rec->sa_cap = cfs_curproc_cap_pack();
+ void mdc_create_pack(struct ptlrpc_request *req, int offset,
+ struct mdc_op_data *op_data, const void *data, int datalen,
+- __u32 mode, __u32 uid, __u32 gid, __u32 cap_effective,
++ __u32 mode, __u32 uid, __u32 gid, cfs_cap_t cap_effective,
+ __u64 rdev)
+ {
+ struct mds_rec_create *rec;
+@@ -168,7 +168,7 @@ void mdc_open_pack(struct ptlrpc_request
+ rec->cr_opcode = REINT_OPEN;
+ rec->cr_fsuid = current->fsuid;
+ rec->cr_fsgid = current->fsgid;
+- rec->cr_cap = current->cap_effective;
++ rec->cr_cap = cfs_curproc_cap_pack();
+ rec->cr_fid = op_data->fid1;
+ memset(&rec->cr_replayfid, 0, sizeof(rec->cr_replayfid));
+ rec->cr_mode = mode;
+@@ -242,7 +242,7 @@ void mdc_setattr_pack(struct ptlrpc_requ
+ rec->sa_opcode = REINT_SETATTR;
+ rec->sa_fsuid = current->fsuid;
+ rec->sa_fsgid = current->fsgid;
+- rec->sa_cap = current->cap_effective;
++ rec->sa_cap = cfs_curproc_cap_pack();
+ rec->sa_fid = data->fid1;
rec->sa_suppgid = -1;
- rec->sa_fid = op_data->op_fid1;
-@@ -452,7 +452,7 @@ void mdc_getattr_pack(struct ptlrpc_requ
+@@ -286,7 +286,7 @@ void mdc_unlink_pack(struct ptlrpc_reque
+ rec->ul_opcode = REINT_UNLINK;
+ rec->ul_fsuid = current->fsuid;
+ rec->ul_fsgid = current->fsgid;
+- rec->ul_cap = current->cap_effective;
++ rec->ul_cap = cfs_curproc_cap_pack();
+ rec->ul_mode = data->create_mode;
+ rec->ul_suppgid = data->suppgids[0];
+ rec->ul_fid1 = data->fid1;
+@@ -309,7 +309,7 @@ void mdc_link_pack(struct ptlrpc_request
+ rec->lk_opcode = REINT_LINK;
+ rec->lk_fsuid = current->fsuid;
+ rec->lk_fsgid = current->fsgid;
+- rec->lk_cap = current->cap_effective;
++ rec->lk_cap = cfs_curproc_cap_pack();
+ rec->lk_suppgid1 = data->suppgids[0];
+ rec->lk_suppgid2 = data->suppgids[1];
+ rec->lk_fid1 = data->fid1;
+@@ -333,7 +333,7 @@ void mdc_rename_pack(struct ptlrpc_reque
+ rec->rn_opcode = REINT_RENAME;
+ rec->rn_fsuid = current->fsuid;
+ rec->rn_fsgid = current->fsgid;
+- rec->rn_cap = current->cap_effective;
++ rec->rn_cap = cfs_curproc_cap_pack();
+ rec->rn_suppgid1 = data->suppgids[0];
+ rec->rn_suppgid2 = data->suppgids[1];
+ rec->rn_fid1 = data->fid1;
+@@ -357,7 +357,7 @@ void mdc_getattr_pack(struct ptlrpc_requ
b->fsuid = current->fsuid;
b->fsgid = current->fsgid;
- b->capability = current->cap_effective;
+ b->capability = cfs_curproc_cap_pack();
b->valid = valid;
- if (op_data->op_bias & MDS_CHECK_SPLIT)
- b->valid |= OBD_MD_FLCKSPLIT;
-Index: lustre/mdc/mdc_reint.c
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/mdc/mdc_reint.c,v
-retrieving revision 1.75
-diff -u -p -r1.75 mdc_reint.c
---- lustre/mdc/mdc_reint.c 27 Jul 2008 21:25:11 -0000 1.75
-+++ lustre/mdc/mdc_reint.c 1 Sep 2008 15:26:55 -0000
-@@ -205,7 +205,8 @@ int mdc_setattr(struct obd_export *exp,
-
- int mdc_create(struct obd_export *exp, struct md_op_data *op_data,
+ b->flags = flags | MDS_BFLAG_EXT_FLAGS;
+ /* skip MDS_BFLAG_EXT_FLAGS to verify the "client < 1.4.7" case
+diff -u -p -r1.64.34.9 mdc_reint.c
+--- lustre/mdc/mdc_reint.c 7 Aug 2008 09:53:47 -0000 1.64.34.9
++++ lustre/mdc/mdc_reint.c 11 Sep 2008 11:42:28 -0000
+@@ -176,7 +176,8 @@ int mdc_setattr(struct obd_export *exp,
+
+ int mdc_create(struct obd_export *exp, struct mdc_op_data *op_data,
const void *data, int datalen, int mode, __u32 uid, __u32 gid,
- __u32 cap_effective, __u64 rdev, struct ptlrpc_request **request)
+ cfs_cap_t cap_effective, __u64 rdev,
+ struct ptlrpc_request **request)
{
- struct ptlrpc_request *req;
- int level, rc;
-Index: lustre/mdc/mdc_request.c
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/mdc/mdc_request.c,v
-retrieving revision 1.266
-diff -u -p -r1.266 mdc_request.c
---- lustre/mdc/mdc_request.c 27 Jul 2008 21:25:11 -0000 1.266
-+++ lustre/mdc/mdc_request.c 1 Sep 2008 15:26:55 -0000
-@@ -374,7 +374,7 @@ static int mdc_xattr_common(struct obd_e
- */
- rec->sx_fsuid = current->fsuid;
- rec->sx_fsgid = current->fsgid;
-- rec->sx_cap = current->cap_effective;
-+ rec->sx_cap = cfs_curproc_cap_pack();
- rec->sx_suppgid1 = suppgid;
- rec->sx_suppgid2 = -1;
- rec->sx_fid = *fid;
-Index: lustre/mdd/mdd_dir.c
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/mdd/mdd_dir.c,v
-retrieving revision 1.8
-diff -u -p -r1.8 mdd_dir.c
---- lustre/mdd/mdd_dir.c 27 Jul 2008 21:25:15 -0000 1.8
-+++ lustre/mdd/mdd_dir.c 1 Sep 2008 15:26:56 -0000
-@@ -359,7 +359,7 @@ static inline int mdd_is_sticky(const st
- if (tmp_la->la_uid == uc->mu_fsuid)
- return 0;
-
-- return !mdd_capable(uc, CAP_FOWNER);
-+ return !mdd_capable(uc, CFS_CAP_FOWNER);
- }
-
- /*
-Index: lustre/mdd/mdd_internal.h
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/mdd/mdd_internal.h,v
-retrieving revision 1.9
-diff -u -p -r1.9 mdd_internal.h
---- lustre/mdd/mdd_internal.h 27 Jul 2008 21:25:16 -0000 1.9
-+++ lustre/mdd/mdd_internal.h 1 Sep 2008 15:26:56 -0000
-@@ -326,7 +326,7 @@ struct mdd_object *mdd_object_find(const
- #define mdd_cap_raised(c, flag) (mdd_cap_t(c) & MDD_CAP_TO_MASK(flag))
-
- /* capable() is copied from linux kernel! */
--static inline int mdd_capable(struct md_ucred *uc, int cap)
-+static inline int mdd_capable(struct md_ucred *uc, cfs_cap_t cap)
- {
- if (mdd_cap_raised(uc->mu_cap, cap))
- return 1;
-Index: lustre/mdd/mdd_lov.c
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/mdd/mdd_lov.c,v
-retrieving revision 1.10
-diff -u -p -r1.10 mdd_lov.c
---- lustre/mdd/mdd_lov.c 27 Jul 2008 21:25:16 -0000 1.10
-+++ lustre/mdd/mdd_lov.c 1 Sep 2008 15:26:56 -0000
-@@ -294,7 +294,8 @@ int mdd_lsm_sanity_check(const struct lu
- if (rc)
- RETURN(rc);
-
-- if ((uc->mu_fsuid != tmp_la->la_uid) && !mdd_capable(uc, CAP_FOWNER))
-+ if ((uc->mu_fsuid != tmp_la->la_uid) &&
-+ !mdd_capable(uc, CFS_CAP_FOWNER))
- rc = mdd_permission_internal_locked(env, obj, tmp_la,
- MAY_WRITE);
-
-Index: lustre/mdd/mdd_object.c
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/mdd/mdd_object.c,v
-retrieving revision 1.16
-diff -u -p -r1.16 mdd_object.c
---- lustre/mdd/mdd_object.c 27 Jul 2008 21:25:16 -0000 1.16
-+++ lustre/mdd/mdd_object.c 1 Sep 2008 15:26:56 -0000
-@@ -696,7 +696,7 @@ static int mdd_fix_attr(const struct lu_
- (LUSTRE_IMMUTABLE_FL | LUSTRE_APPEND_FL);
-
- if ((uc->mu_fsuid != tmp_la->la_uid) &&
-- !mdd_capable(uc, CAP_FOWNER))
-+ !mdd_capable(uc, CFS_CAP_FOWNER))
- RETURN(-EPERM);
-
- /* XXX: the IMMUTABLE and APPEND_ONLY flags can
-@@ -706,7 +706,7 @@ static int mdd_fix_attr(const struct lu_
- if (mdd_is_append(obj))
- oldflags |= LUSTRE_APPEND_FL;
- if ((oldflags ^ newflags) &&
-- !mdd_capable(uc, CAP_LINUX_IMMUTABLE))
-+ !mdd_capable(uc, CFS_CAP_LINUX_IMMUTABLE))
- RETURN(-EPERM);
-
- if (!S_ISDIR(tmp_la->la_mode))
-@@ -722,7 +722,7 @@ static int mdd_fix_attr(const struct lu_
- if ((la->la_valid & (LA_MTIME | LA_ATIME | LA_CTIME)) &&
- !(la->la_valid & ~(LA_MTIME | LA_ATIME | LA_CTIME))) {
- if ((uc->mu_fsuid != tmp_la->la_uid) &&
-- !mdd_capable(uc, CAP_FOWNER)) {
-+ !mdd_capable(uc, CFS_CAP_FOWNER)) {
- rc = mdd_permission_internal_locked(env, obj, tmp_la,
- MAY_WRITE);
- if (rc)
-@@ -736,7 +736,7 @@ static int mdd_fix_attr(const struct lu_
- * this is for changing file with SUID or SGID. */
- if ((la->la_valid & ~LA_MODE) &&
- (uc->mu_fsuid != tmp_la->la_uid) &&
-- !mdd_capable(uc, CAP_FOWNER))
-+ !mdd_capable(uc, CFS_CAP_FOWNER))
- RETURN(-EPERM);
-
- if (la->la_mode == (umode_t) -1)
-@@ -746,8 +746,9 @@ static int mdd_fix_attr(const struct lu_
- (tmp_la->la_mode & ~S_IALLUGO);
-
- /* Also check the setgid bit! */
-- if (!lustre_in_group_p(uc, (la->la_valid & LA_GID) ? la->la_gid :
-- tmp_la->la_gid) && !mdd_capable(uc, CAP_FSETID))
-+ if (!lustre_in_group_p(uc, (la->la_valid & LA_GID) ?
-+ la->la_gid : tmp_la->la_gid) &&
-+ !mdd_capable(uc, CFS_CAP_FSETID))
- la->la_mode &= ~S_ISGID;
- } else {
- la->la_mode = tmp_la->la_mode;
-@@ -759,7 +760,7 @@ static int mdd_fix_attr(const struct lu_
- la->la_uid = tmp_la->la_uid;
- if (((uc->mu_fsuid != tmp_la->la_uid) ||
- (la->la_uid != tmp_la->la_uid)) &&
-- !mdd_capable(uc, CAP_CHOWN))
-+ !mdd_capable(uc, CFS_CAP_CHOWN))
- RETURN(-EPERM);
-
- /* If the user or group of a non-directory has been
-@@ -785,7 +786,7 @@ static int mdd_fix_attr(const struct lu_
- if (((uc->mu_fsuid != tmp_la->la_uid) ||
- ((la->la_gid != tmp_la->la_gid) &&
- !lustre_in_group_p(uc, la->la_gid))) &&
-- !mdd_capable(uc, CAP_CHOWN))
-+ !mdd_capable(uc, CFS_CAP_CHOWN))
- RETURN(-EPERM);
-
- /* Likewise, if the user or group of a non-directory
-@@ -960,7 +961,8 @@ static int mdd_xattr_sanity_check(const
- if (rc)
- RETURN(rc);
-
-- if ((uc->mu_fsuid != tmp_la->la_uid) && !mdd_capable(uc, CAP_FOWNER))
-+ if ((uc->mu_fsuid != tmp_la->la_uid) &&
-+ !mdd_capable(uc, CFS_CAP_FOWNER))
- RETURN(-EPERM);
-
- RETURN(rc);
-@@ -1298,7 +1300,7 @@ static int mdd_open_sanity_check(const s
- if (uc && ((uc->mu_valid == UCRED_OLD) ||
- (uc->mu_valid == UCRED_NEW)) &&
- (uc->mu_fsuid != tmp_la->la_uid) &&
-- !mdd_capable(uc, CAP_FOWNER))
-+ !mdd_capable(uc, CFS_CAP_FOWNER))
- RETURN(-EPERM);
+ CFS_LIST_HEAD(cancels);
+ struct obd_device *obd = exp->exp_obd;
+diff -u -p -r1.72.34.14 mds_internal.h
+--- lustre/mds/mds_internal.h 7 Aug 2008 09:54:01 -0000 1.72.34.14
++++ lustre/mds/mds_internal.h 11 Sep 2008 11:42:28 -0000
+@@ -198,7 +198,7 @@ int mds_init_ucred(struct lvfs_ucred *uc
+ int offset);
+ void mds_exit_ucred(struct lvfs_ucred *ucred, struct mds_obd *obd);
+ void mds_root_squash(struct mds_obd *mds, lnet_nid_t *peernid,
+- __u32 *fsuid, __u32 *fsgid, __u32 *cap,
++ __u32 *fsuid, __u32 *fsgid, cfs_kernel_cap_t *cap,
+ __u32 *suppgid, __u32 *suppgid2);
+
+ /* mds/mds_unlink_open.c */
+diff -u -p -r1.43.34.16 mds_lib.c
+--- lustre/mds/mds_lib.c 6 Sep 2008 11:45:11 -0000 1.43.34.16
++++ lustre/mds/mds_lib.c 11 Sep 2008 11:42:28 -0000
+@@ -156,7 +156,7 @@ static int mds_setattr_unpack(struct ptl
+
+ r->ur_uc.luc_fsuid = rec->sa_fsuid;
+ r->ur_uc.luc_fsgid = rec->sa_fsgid;
+- r->ur_uc.luc_cap = rec->sa_cap;
++ cfs_kernel_cap_unpack(&r->ur_uc.luc_cap, rec->sa_cap);
+ r->ur_uc.luc_suppgid1 = rec->sa_suppgid;
+ r->ur_uc.luc_suppgid2 = -1;
+ r->ur_fid1 = &rec->sa_fid;
+@@ -206,7 +206,7 @@ static int mds_create_unpack(struct ptlr
+
+ r->ur_uc.luc_fsuid = rec->cr_fsuid;
+ r->ur_uc.luc_fsgid = rec->cr_fsgid;
+- r->ur_uc.luc_cap = rec->cr_cap;
++ cfs_kernel_cap_unpack(&r->ur_uc.luc_cap, rec->cr_cap);
+ r->ur_uc.luc_suppgid1 = rec->cr_suppgid;
+ r->ur_uc.luc_suppgid2 = -1;
+ r->ur_fid1 = &rec->cr_fid;
+@@ -259,7 +259,7 @@ static int mds_link_unpack(struct ptlrpc
+
+ r->ur_uc.luc_fsuid = rec->lk_fsuid;
+ r->ur_uc.luc_fsgid = rec->lk_fsgid;
+- r->ur_uc.luc_cap = rec->lk_cap;
++ cfs_kernel_cap_unpack(&r->ur_uc.luc_cap, rec->lk_cap);
+ r->ur_uc.luc_suppgid1 = rec->lk_suppgid1;
+ r->ur_uc.luc_suppgid2 = rec->lk_suppgid2;
+ r->ur_fid1 = &rec->lk_fid1;
+@@ -294,7 +294,7 @@ static int mds_unlink_unpack(struct ptlr
+
+ r->ur_uc.luc_fsuid = rec->ul_fsuid;
+ r->ur_uc.luc_fsgid = rec->ul_fsgid;
+- r->ur_uc.luc_cap = rec->ul_cap;
++ cfs_kernel_cap_unpack(&r->ur_uc.luc_cap, rec->ul_cap);
+ r->ur_uc.luc_suppgid1 = rec->ul_suppgid;
+ r->ur_uc.luc_suppgid2 = -1;
+ r->ur_mode = rec->ul_mode;
+@@ -331,7 +331,7 @@ static int mds_rename_unpack(struct ptlr
+
+ r->ur_uc.luc_fsuid = rec->rn_fsuid;
+ r->ur_uc.luc_fsgid = rec->rn_fsgid;
+- r->ur_uc.luc_cap = rec->rn_cap;
++ cfs_kernel_cap_unpack(&r->ur_uc.luc_cap, rec->rn_cap);
+ r->ur_uc.luc_suppgid1 = rec->rn_suppgid1;
+ r->ur_uc.luc_suppgid2 = rec->rn_suppgid2;
+ r->ur_fid1 = &rec->rn_fid1;
+@@ -372,7 +372,7 @@ static int mds_open_unpack(struct ptlrpc
+
+ r->ur_uc.luc_fsuid = rec->cr_fsuid;
+ r->ur_uc.luc_fsgid = rec->cr_fsgid;
+- r->ur_uc.luc_cap = rec->cr_cap;
++ cfs_kernel_cap_unpack(&r->ur_uc.luc_cap, rec->cr_cap);
+ r->ur_uc.luc_suppgid1 = rec->cr_suppgid;
+ r->ur_uc.luc_suppgid2 = -1;
+ r->ur_fid1 = &rec->cr_fid;
+@@ -440,7 +440,7 @@ int mds_update_unpack(struct ptlrpc_requ
+ }
+
+ void mds_root_squash(struct mds_obd *mds, lnet_nid_t *peernid,
+- __u32 *fsuid, __u32 *fsgid, __u32 *cap,
++ __u32 *fsuid, __u32 *fsgid, cfs_kernel_cap_t *kcap,
+ __u32 *suppgid, __u32 *suppgid2)
+ {
+ if (!mds->mds_squash_uid || *fsuid)
+@@ -449,13 +449,13 @@ void mds_root_squash(struct mds_obd *mds
+ if (*peernid == mds->mds_nosquash_nid)
+ return;
+
+- CDEBUG(D_OTHER, "squash req from %s, (%d:%d/%x)=>(%d:%d/%x)\n",
+- libcfs_nid2str(*peernid), *fsuid, *fsgid, *cap,
+- mds->mds_squash_uid, mds->mds_squash_gid, 0);
++ CDEBUG(D_OTHER, "squash req from %s, (%d:%d)=>(%d:%d)\n",
++ libcfs_nid2str(*peernid), *fsuid, *fsgid,
++ mds->mds_squash_uid, mds->mds_squash_gid);
+
+ *fsuid = mds->mds_squash_uid;
+ *fsgid = mds->mds_squash_gid;
+- *cap = 0;
++ cfs_kernel_cap_unpack(kcap, 0);
+ *suppgid = -1;
+ if (suppgid2)
+ *suppgid2 = -1;
+@@ -479,13 +479,13 @@ int mds_init_ucred(struct lvfs_ucred *uc
+ } else
+ #endif
+ {
++ cfs_kernel_cap_unpack(&ucred->luc_cap, body->capability);
+ mds_root_squash(mds, &req->rq_peer.nid, &body->fsuid,
+- &body->fsgid, &body->capability,
++ &body->fsgid, &ucred->luc_cap,
+ &body->suppgid, NULL);
+
+ ucred->luc_fsuid = body->fsuid;
+ ucred->luc_fsgid = body->fsgid;
+- ucred->luc_cap = body->capability;
+ }
+
+ ucred->luc_uce = upcall_cache_get_entry(mds->mds_group_hash,
+diff -u -p -r1.264.32.22 mds_reint.c
+--- lustre/mds/mds_reint.c 28 Aug 2008 14:18:04 -0000 1.264.32.22
++++ lustre/mds/mds_reint.c 11 Sep 2008 11:42:29 -0000
+@@ -2462,7 +2462,7 @@ int mds_reint_rec(struct mds_update_reco
+ * NB root's creds are believed... */
+ LASSERT (req->rq_uid != 0);
+ rec->ur_uc.luc_fsuid = req->rq_uid;
+- rec->ur_uc.luc_cap = 0;
++ cfs_kernel_cap_unpack(&rec->ur_uc.luc_cap, 0);
}
#endif
-Index: lustre/mdd/mdd_permission.c
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/mdd/mdd_permission.c,v
-retrieving revision 1.5
-diff -u -p -r1.5 mdd_permission.c
---- lustre/mdd/mdd_permission.c 27 Jul 2008 21:25:17 -0000 1.5
-+++ lustre/mdd/mdd_permission.c 1 Sep 2008 15:26:56 -0000
-@@ -286,12 +286,12 @@ int __mdd_permission_internal(const stru
- check_capabilities:
- if (!(mask & MAY_EXEC) ||
- (la->la_mode & S_IXUGO) || S_ISDIR(la->la_mode))
-- if (mdd_capable(uc, CAP_DAC_OVERRIDE))
-+ if (mdd_capable(uc, CFS_CAP_DAC_OVERRIDE))
- RETURN(0);
-
- if ((mask == MAY_READ) ||
- (S_ISDIR(la->la_mode) && !(mask & MAY_WRITE)))
-- if (mdd_capable(uc, CAP_DAC_READ_SEARCH))
-+ if (mdd_capable(uc, CFS_CAP_DAC_READ_SEARCH))
- RETURN(0);
-
- RETURN(-EACCES);
-@@ -392,7 +392,8 @@ int mdd_permission(const struct lu_env *
- RETURN(rc);
- }
-
-- if (la->la_uid != uc->mu_fsuid && !mdd_capable(uc, CAP_FOWNER))
-+ if (la->la_uid != uc->mu_fsuid &&
-+ !mdd_capable(uc, CFS_CAP_FOWNER))
- rc = -EPERM;
- }
-
-Index: lustre/mdt/mdt_lib.c
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/mdt/mdt_lib.c,v
-retrieving revision 1.13
-diff -u -p -r1.13 mdt_lib.c
---- lustre/mdt/mdt_lib.c 27 Jul 2008 21:25:24 -0000 1.13
-+++ lustre/mdt/mdt_lib.c 1 Sep 2008 15:26:56 -0000
-@@ -243,7 +243,7 @@ static int new_init_ucred(struct mdt_thr
-
- /* remove fs privilege for non-root user */
- if (ucred->mu_fsuid)
-- ucred->mu_cap = pud->pud_cap & ~CAP_FS_MASK;
-+ ucred->mu_cap = pud->pud_cap & ~CFS_CAP_FS_MASK;
- else
- ucred->mu_cap = pud->pud_cap;
- ucred->mu_valid = UCRED_NEW;
-@@ -406,7 +406,7 @@ static int old_init_ucred(struct mdt_thr
-
- /* remove fs privilege for non-root user */
- if (uc->mu_fsuid)
-- uc->mu_cap = body->capability & ~CAP_FS_MASK;
-+ uc->mu_cap = body->capability & ~CFS_CAP_FS_MASK;
- else
- uc->mu_cap = body->capability;
- uc->mu_valid = UCRED_OLD;
-@@ -446,7 +446,7 @@ static int old_init_ucred_reint(struct m
-
- /* remove fs privilege for non-root user */
- if (uc->mu_fsuid)
-- uc->mu_cap &= ~CAP_FS_MASK;
-+ uc->mu_cap &= ~CFS_CAP_FS_MASK;
- uc->mu_valid = UCRED_OLD;
-
- RETURN(0);
-Index: lustre/obdclass/llog_obd.c
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/obdclass/llog_obd.c,v
-retrieving revision 1.24
-diff -u -p -r1.24 llog_obd.c
---- lustre/obdclass/llog_obd.c 27 Jul 2008 21:25:35 -0000 1.24
-+++ lustre/obdclass/llog_obd.c 1 Sep 2008 15:26:56 -0000
-@@ -210,8 +210,7 @@ int llog_add(struct llog_ctxt *ctxt, str
+
+diff -u -p -r1.17.34.13 llog_obd.c
+--- lustre/obdclass/llog_obd.c 5 Sep 2008 11:14:48 -0000 1.17.34.13
++++ lustre/obdclass/llog_obd.c 11 Sep 2008 11:42:29 -0000
+@@ -206,8 +206,7 @@ int llog_add(struct llog_ctxt *ctxt, str
struct lov_stripe_md *lsm, struct llog_cookie *logcookies,
int numcookies)
{
@@ -1257,30 +994,26 @@
ENTRY;
if (!ctxt) {
-@@ -220,10 +219,12 @@ int llog_add(struct llog_ctxt *ctxt, str
+@@ -216,10 +215,12 @@ int llog_add(struct llog_ctxt *ctxt, str
}
CTXT_CHECK_OP(ctxt, add, -EOPNOTSUPP);
-- cap = current->cap_effective;
+- cap = current->cap_effective;
- cap_raise(current->cap_effective, CAP_SYS_RESOURCE);
+ raised = cfs_cap_raised(CFS_CAP_SYS_RESOURCE);
+ if (!raised)
+ cfs_cap_raise(CFS_CAP_SYS_RESOURCE);
rc = CTXTP(ctxt, add)(ctxt, rec, lsm, logcookies, numcookies);
-- current->cap_effective = cap;
+- current->cap_effective = cap;
+ if (!raised)
+ cfs_cap_lower(CFS_CAP_SYS_RESOURCE);
RETURN(rc);
}
EXPORT_SYMBOL(llog_add);
-Index: lustre/obdclass/obdo.c
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/obdclass/obdo.c,v
-retrieving revision 1.12
-diff -u -p -r1.12 obdo.c
---- lustre/obdclass/obdo.c 27 Jul 2008 21:25:39 -0000 1.12
-+++ lustre/obdclass/obdo.c 1 Sep 2008 15:26:57 -0000
-@@ -164,7 +164,7 @@ void obdo_from_iattr(struct obdo *oa, st
+diff -u -p -r1.2.34.3 linux-obdo.c
+--- lustre/obdclass/linux/linux-obdo.c 7 Aug 2008 09:55:16 -0000 1.2.34.3
++++ lustre/obdclass/linux/linux-obdo.c 11 Sep 2008 11:42:29 -0000
+@@ -78,7 +78,7 @@ void obdo_from_iattr(struct obdo *oa, st
if (ia_valid & ATTR_MODE) {
oa->o_mode = attr->ia_mode;
oa->o_valid |= OBD_MD_FLTYPE | OBD_MD_FLMODE;
@@ -1289,7 +1022,7 @@
oa->o_mode &= ~S_ISGID;
}
if (ia_valid & ATTR_UID) {
-@@ -212,7 +212,7 @@ void iattr_from_obdo(struct iattr *attr,
+@@ -126,7 +126,7 @@ void iattr_from_obdo(struct iattr *attr,
if (valid & OBD_MD_FLMODE) {
attr->ia_mode = (attr->ia_mode & S_IFMT)|(oa->o_mode & ~S_IFMT);
attr->ia_valid |= ATTR_MODE;
@@ -1298,13 +1031,9 @@
attr->ia_mode &= ~S_ISGID;
}
if (valid & OBD_MD_FLUID) {
-Index: lustre/obdecho/echo_client.c
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/obdecho/echo_client.c,v
-retrieving revision 1.49
-diff -u -p -r1.49 echo_client.c
---- lustre/obdecho/echo_client.c 27 Jul 2008 21:25:45 -0000 1.49
-+++ lustre/obdecho/echo_client.c 1 Sep 2008 15:26:57 -0000
+diff -u -p -r1.40.32.10 echo_client.c
+--- lustre/obdecho/echo_client.c 7 Aug 2008 09:55:23 -0000 1.40.32.10
++++ lustre/obdecho/echo_client.c 11 Sep 2008 11:42:29 -0000
@@ -1148,7 +1148,7 @@ echo_client_iocontrol(unsigned int cmd,
switch (cmd) {
@@ -1321,9 +1050,9 @@
- if (!capable (CAP_SYS_ADMIN))
+ if (!cfs_capable(CFS_CAP_SYS_ADMIN))
GOTO (out, rc = -EPERM);
-
rc = echo_get_object (&eco, obd, &data->ioc_obdo1);
-@@ -1185,7 +1185,7 @@ echo_client_iocontrol(unsigned int cmd,
+ if (rc == 0) {
+@@ -1184,7 +1184,7 @@ echo_client_iocontrol(unsigned int cmd,
GOTO(out, rc);
case OBD_IOC_SETATTR:
@@ -1332,7 +1061,7 @@
GOTO (out, rc = -EPERM);
rc = echo_get_object (&eco, obd, &data->ioc_obdo1);
-@@ -1200,7 +1200,7 @@ echo_client_iocontrol(unsigned int cmd,
+@@ -1199,7 +1199,7 @@ echo_client_iocontrol(unsigned int cmd,
GOTO(out, rc);
case OBD_IOC_BRW_WRITE:
@@ -1341,7 +1070,7 @@
GOTO (out, rc = -EPERM);
rw = OBD_BRW_WRITE;
-@@ -1219,7 +1219,7 @@ echo_client_iocontrol(unsigned int cmd,
+@@ -1218,7 +1218,7 @@ echo_client_iocontrol(unsigned int cmd,
GOTO(out, rc);
case ECHO_IOC_SET_STRIPE:
@@ -1350,7 +1079,7 @@
GOTO (out, rc = -EPERM);
if (data->ioc_pbuf1 == NULL) { /* unset */
-@@ -1236,7 +1236,7 @@ echo_client_iocontrol(unsigned int cmd,
+@@ -1235,7 +1235,7 @@ echo_client_iocontrol(unsigned int cmd,
GOTO (out, rc);
case ECHO_IOC_ENQUEUE:
@@ -1359,14 +1088,10 @@
GOTO (out, rc = -EPERM);
rc = echo_client_enqueue(exp, &data->ioc_obdo1,
-Index: lustre/obdfilter/filter.c
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/obdfilter/filter.c,v
-retrieving revision 1.295
-diff -u -p -r1.295 filter.c
---- lustre/obdfilter/filter.c 27 Jul 2008 21:25:46 -0000 1.295
-+++ lustre/obdfilter/filter.c 1 Sep 2008 15:26:57 -0000
-@@ -1562,8 +1562,9 @@ int filter_vfs_unlink(struct inode *dir,
+diff -u -p -r1.247.2.62 filter.c
+--- lustre/obdfilter/filter.c 5 Sep 2008 11:14:51 -0000 1.247.2.62
++++ lustre/obdfilter/filter.c 11 Sep 2008 11:42:29 -0000
+@@ -1352,8 +1352,9 @@ int filter_vfs_unlink(struct inode *dir,
GOTO(out, rc = -EPERM);
/* check_sticky() */
@@ -1378,14 +1103,10 @@
GOTO(out, rc = -EPERM);
/* NOTE: This might need to go outside i_mutex, though it isn't clear if
-Index: lustre/obdfilter/filter_io_26.c
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/obdfilter/filter_io_26.c,v
-retrieving revision 1.49
-diff -u -p -r1.49 filter_io_26.c
---- lustre/obdfilter/filter_io_26.c 27 Jul 2008 21:25:48 -0000 1.49
-+++ lustre/obdfilter/filter_io_26.c 1 Sep 2008 15:26:57 -0000
-@@ -754,7 +754,7 @@ int filter_commitrw_write(struct obd_exp
+diff -u -p -r1.20.34.7 filter_io_24.c
+--- lustre/obdfilter/filter_io_24.c 7 Aug 2008 09:55:35 -0000 1.20.34.7
++++ lustre/obdfilter/filter_io_24.c 11 Sep 2008 11:42:29 -0000
+@@ -505,7 +505,7 @@ int filter_commitrw_write(struct obd_exp
CDEBUG(D_INODE, "update UID/GID to %lu/%lu\n",
(unsigned long)oa->o_uid, (unsigned long)oa->o_gid);
@@ -1394,30 +1115,34 @@
iattr.ia_valid |= ATTR_MODE;
iattr.ia_mode = inode->i_mode;
-Index: lustre/ptlrpc/sec.c
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/ptlrpc/sec.c,v
-retrieving revision 1.14
-diff -u -p -r1.14 sec.c
---- lustre/ptlrpc/sec.c 27 Jul 2008 21:26:07 -0000 1.14
-+++ lustre/ptlrpc/sec.c 1 Sep 2008 15:26:58 -0000
-@@ -2203,7 +2203,7 @@ int sptlrpc_pack_user_desc(struct lustre
- pud->pud_gid = cfs_current()->gid;
- pud->pud_fsuid = cfs_current()->fsuid;
- pud->pud_fsgid = cfs_current()->fsgid;
-- pud->pud_cap = cfs_current()->cap_effective;
-+ pud->pud_cap = cfs_curproc_cap_pack();
- pud->pud_ngroups = (msg->lm_buflens[offset] - sizeof(*pud)) / 4;
-
- #ifdef __KERNEL__
-Index: lustre/quota/quota_interface.c
-===================================================================
-RCS file: /cvsroot/cfs/lustre-core/quota/quota_interface.c,v
-retrieving revision 1.8
-diff -u -p -r1.8 quota_interface.c
---- lustre/quota/quota_interface.c 27 Jul 2008 21:26:19 -0000 1.8
-+++ lustre/quota/quota_interface.c 1 Sep 2008 15:26:58 -0000
-@@ -353,9 +353,9 @@ static int filter_quota_enforce(struct o
+diff -u -p -r1.41.12.16 filter_io_26.c
+--- lustre/obdfilter/filter_io_26.c 7 Aug 2008 09:55:37 -0000 1.41.12.16
++++ lustre/obdfilter/filter_io_26.c 11 Sep 2008 11:42:29 -0000
+@@ -744,7 +744,7 @@ int filter_commitrw_write(struct obd_exp
+ CDEBUG(D_INODE, "update UID/GID to %lu/%lu\n",
+ (unsigned long)oa->o_uid, (unsigned long)oa->o_gid);
+
+- cap_raise(current->cap_effective, CAP_SYS_RESOURCE);
++ cfs_cap_raise(CFS_CAP_SYS_RESOURCE);
+
+ iattr.ia_valid |= ATTR_MODE;
+ iattr.ia_mode = inode->i_mode;
+diff -u -p -r1.284.6.64 osc_request.c
+--- lustre/osc/osc_request.c 2 Sep 2008 22:42:25 -0000 1.284.6.64
++++ lustre/osc/osc_request.c 11 Sep 2008 11:42:29 -0000
+@@ -3426,7 +3426,7 @@ static int osc_iocontrol(unsigned int cm
+ case OBD_IOC_DESTROY: {
+ struct obdo *oa;
+
+- if (!capable (CAP_SYS_ADMIN))
++ if (!cfs_capable(CFS_CAP_SYS_ADMIN))
+ GOTO (out, err = -EPERM);
+ oa = &data->ioc_obdo1;
+
+diff -u -p -r1.3.12.20 quota_interface.c
+--- lustre/quota/quota_interface.c 5 Sep 2008 06:41:09 -0000 1.3.12.20
++++ lustre/quota/quota_interface.c 11 Sep 2008 11:42:29 -0000
+@@ -143,9 +143,9 @@ static int filter_quota_enforce(struct o
RETURN(0);
if (ignore)
More information about the Pkg-lustre-svn-commit
mailing list