The following commit has been merged in the master branch: commit 521478882e037cf7f54b954d30f9e48b93a94f25 Author: Patrick Winnertz <[EMAIL PROTECTED]> Date: Fri Oct 10 10:07:10 2008 +0200
Removed unused patch from debian/patches/ diff --git a/debian/patches/bug_15949_mds.body_capacity.dpatch b/debian/patches/bug_15949_mds.body_capacity.dpatch deleted file mode 100644 index cb0ae06..0000000 --- a/debian/patches/bug_15949_mds.body_capacity.dpatch +++ /dev/null @@ -1,1156 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## bug_15949_mds.body_capacity.dpatch by Patrick Winnertz <[EMAIL PROTECTED]> -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: Patch from bug 15949 (is closed in 1.6.7) - [EMAIL PROTECTED]@ -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 - */ --cfs_kernel_cap_t cfs_curproc_cap_get(void); --void cfs_curproc_cap_set(cfs_kernel_cap_t cap); - #endif - -+typedef __u32 cfs_cap_t; -+ -+#define CFS_CAP_CHOWN 0 -+#define CFS_CAP_DAC_OVERRIDE 1 -+#define CFS_CAP_DAC_READ_SEARCH 2 -+#define CFS_CAP_FOWNER 3 -+#define CFS_CAP_FSETID 4 -+#define CFS_CAP_LINUX_IMMUTABLE 9 -+#define CFS_CAP_SYS_ADMIN 21 -+#define CFS_CAP_SYS_BOOT 23 -+#define CFS_CAP_SYS_RESOURCE 24 -+ -+#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); -+ - /* __LIBCFS_CURPROC_H__ */ - #endif - /* -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) - --#define CAP_SYS_BOOT 0 --#define CAP_SYS_ADMIN 1 --#define capable(a) ((a) == CAP_SYS_BOOT ? is_suser(): is_suser1()) -- - #define USERMODEHELPER(path, argv, envp) (0) - - #define cfs_module(name, version, init, fini) \ -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 - */ --typedef int cfs_kernel_cap_t; -+typedef __u32 cfs_kernel_cap_t; - - #ifdef __KERNEL__ - enum { -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) - --#define CAP_SYS_ADMIN 0 --#define CAP_SYS_ROOT 1 -- --#define capable(a) (TRUE) -- - #define USERMODEHELPER(path, argv, envp) (0) - - -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... */ - -- if (!capable(CAP_SYS_ADMIN)) -+ if (!cfs_capable(CFS_CAP_SYS_ADMIN)) - return (-EPERM); - - if (user_size > 0 && -@@ -117,7 +117,7 @@ lwt_control (int enable, int clear) - int i; - int j; - -- if (!capable(CAP_SYS_ADMIN)) -+ if (!cfs_capable(CFS_CAP_SYS_ADMIN)) - return (-EPERM); - - if (!enable) { -@@ -164,7 +164,7 @@ lwt_snapshot (cycles_t *now, int *ncpu, - int i; - int j; - -- if (!capable(CAP_SYS_ADMIN)) -+ if (!cfs_capable(CFS_CAP_SYS_ADMIN)) - return (-EPERM); - - *ncpu = num_online_cpus(); -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 - } - --cfs_kernel_cap_t cfs_curproc_cap_get(void) -+void cfs_cap_raise(cfs_cap_t cap) {} -+void cfs_cap_lower(cfs_cap_t cap) {} -+ -+int cfs_cap_raised(cfs_cap_t cap) - { -+ 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; -+ return cap == CFS_CAP_SYS_BOOT ? is_suser(): is_suser1(); - } - -- - /* - * Local variables: - * 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; - } - --cfs_kernel_cap_t cfs_curproc_cap_get(void) -+/* Currently all the CFS_CAP_* defines match CAP_* ones. */ -+#define cfs_cap_pack(cap) (cap) -+#define cfs_cap_unpack(cap) (cap) -+ -+void cfs_cap_raise(cfs_cap_t cap) -+{ -+ cap_raise(cfs_current()->cap_effective, cfs_cap_unpack(cap)); -+} -+ -+void cfs_cap_lower(cfs_cap_t cap) -+{ -+ cap_lower(cfs_current()->cap_effective, cfs_cap_unpack(cap)); -+} -+ -+int cfs_cap_raised(cfs_cap_t cap) -+{ -+ return cap_raised(cfs_current()->cap_effective, cfs_cap_unpack(cap)); -+} -+ -+void cfs_kernel_cap_pack(cfs_kernel_cap_t kcap, cfs_cap_t *cap) -+{ -+#if _LINUX_CAPABILITY_VERSION == 0x19980330 -+ *cap = cfs_cap_pack(kcap); -+#elif _LINUX_CAPABILITY_VERSION == 0x20071026 -+ *cap = cfs_cap_pack(kcap[0]); -+#else -+ #error "need correct _LINUX_CAPABILITY_VERSION " -+#endif -+} -+ -+void cfs_kernel_cap_unpack(cfs_kernel_cap_t *kcap, cfs_cap_t cap) -+{ -+#if _LINUX_CAPABILITY_VERSION == 0x19980330 -+ *kcap = cfs_cap_unpack(cap); -+#elif _LINUX_CAPABILITY_VERSION == 0x20071026 -+ (*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) -+int cfs_capable(cfs_cap_t cap) - { -- current->cap_effective = cap; -+ return capable(cfs_cap_unpack(cap)); - } - - EXPORT_SYMBOL(cfs_curproc_uid); -@@ -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); --EXPORT_SYMBOL(cfs_curproc_cap_get); --EXPORT_SYMBOL(cfs_curproc_cap_set); -+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: -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: -- if (!capable (CAP_SYS_ADMIN)) -+ if (!cfs_capable(CFS_CAP_SYS_ADMIN)) - return -EPERM; - /* go thought */ - } -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; - } - --cfs_kernel_cap_t cfs_curproc_cap_get(void) -+void cfs_cap_raise(cfs_cap_t cap) - { -- return this_task.cap_effective; -+ this_task.cap_effective |= (1 << cap); - } - --void cfs_curproc_cap_set(cfs_kernel_cap_t cap) -+void cfs_cap_lower(cfs_cap_t cap) - { -- this_task.cap_effective = cap; -+ this_task.cap_effective &= ~(1 << cap); - } - -+int cfs_cap_raised(cfs_cap_t cap) -+{ -+ 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) { -+ cfs_cap_t cap; -+ cfs_kernel_cap_pack(this_task.cap_effective, &cap); -+ return cap; -+} -+ -+void cfs_curproc_cap_unpack(cfs_cap_t cap) { -+ cfs_kernel_cap_unpack(&this_task.cap_effective, cap); -+} -+ -+int cfs_capable(cfs_cap_t cap) -+{ -+ return TRUE; -+} - - /* - * Implementation of linux task management routines -@@ -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); --EXPORT_SYMBOL(cfs_curproc_cap_get); --EXPORT_SYMBOL(cfs_curproc_cap_set); -+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); -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: - -- if (!capable (CAP_SYS_ADMIN)) -+ if (!cfs_capable(CFS_CAP_SYS_ADMIN)) - return -EPERM; - break; - } -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); --static inline int capable(int cap) --{ -- if (current->cap_effective & (1 << cap)) -- return 1; -- else -- return 0; --} - - #define set_current_state(foo) do { current->state = foo; } while (0) - -@@ -753,12 +746,6 @@ typedef enum { - CAP_SET=1 - } cap_flag_value_t; - --#define CAP_DAC_OVERRIDE 1 --#define CAP_DAC_READ_SEARCH 2 --#define CAP_FOWNER 3 --#define CAP_FSETID 4 --#define CAP_SYS_ADMIN 21 -- - cap_t cap_get_proc(void); - int cap_get_flag(cap_t, cap_value_t, cap_flag_t, cap_flag_value_t *); - -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__ -- --#define cap_raise(c, flag) do {} while(0) -- --#define CAP_SYS_RESOURCE 24 -- --#endif /* !__KERNEL__ */ -- - static inline void llog_gen_init(struct llog_ctxt *ctxt) - { - struct obd_device *obd = ctxt->loc_exp->exp_obd; -@@ -442,8 +434,7 @@ static inline int llog_write_rec(struct - int numcookies, void *buf, int idx) - { - struct llog_operations *lop; -- __u32 cap; -- int rc, buflen; -+ int raised, rc, buflen; - ENTRY; - - rc = llog_handle2ops(handle, &lop); -@@ -459,10 +450,12 @@ static inline int llog_write_rec(struct - buflen = rec->lrh_len; - LASSERT(size_round(buflen) == buflen); - -- 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 = lop->lop_write_rec(handle, rec, logcookies, numcookies, buf, idx); -- current->cap_effective = cap; -+ if (!raised) -+ cfs_cap_lower(CFS_CAP_SYS_RESOURCE); - RETURN(rc); - } - -@@ -558,8 +551,7 @@ static inline int llog_create(struct llo - struct llog_logid *logid, char *name) - { - struct llog_operations *lop; -- __u32 cap; -- int rc; -+ int raised, rc; - ENTRY; - - rc = llog_obd2ops(ctxt, &lop); -@@ -568,10 +560,12 @@ static inline int llog_create(struct llo - if (lop->lop_create == NULL) - RETURN(-EOPNOTSUPP); - -- 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 = lop->lop_create(ctxt, res, logid, name); -- current->cap_effective = cap; -+ if (!raised) -+ cfs_cap_lower(CFS_CAP_SYS_RESOURCE); - RETURN(rc); - } - -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; - __u32 luc_fsgid; -- __u32 luc_cap; -+ cfs_kernel_cap_t luc_cap; - __u32 luc_uid; - __u32 luc_umask; - }; -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; - } - -+void cfs_cap_raise(cfs_cap_t cap) -+{ -+ current->cap_effective |= (1 << cap); -+} -+ -+void cfs_cap_lower(cfs_cap_t cap) -+{ -+ current->cap_effective &= ~(1 << cap); -+} -+ -+int cfs_cap_raised(cfs_cap_t cap) -+{ -+ 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) { -+ 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_kernel_cap_unpack(&cfs_current()->cap_effective, cap); -+} -+ -+int cfs_capable(cfs_cap_t cap) -+{ -+ return cfs_cap_raised(cap); -+} -+ - int init_lib_portals() - { - int rc; -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)) || - (st->st_mode & S_IXUGO)) -- if (capable(CAP_DAC_OVERRIDE)) -+ if (cfs_capable(CFS_CAP_DAC_OVERRIDE)) - return 0; - - if (mask == MAY_READ || - (S_ISDIR(st->st_mode) && !(mask & MAY_WRITE))) { -- if (capable(CAP_DAC_READ_SEARCH)) -+ if (cfs_capable(CFS_CAP_DAC_READ_SEARCH)) - return 0; - } - -@@ -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; -- if (!in_group_p(st->st_gid) && !capable(CAP_FSETID)) -+ if (!in_group_p(st->st_gid) && !cfs_capable(CFS_CAP_FSETID)) - st->st_mode &= ~S_ISGID; - } - /* mark_inode_dirty(inode); */ -@@ -735,7 +735,7 @@ int llu_setattr_raw(struct inode *inode, - } else { - /* from inode_change_ok() */ - if (current->fsuid != st->st_uid && -- !capable(CAP_FOWNER)) -+ !cfs_capable(CFS_CAP_FOWNER)) - RETURN(-EPERM); - } - } -@@ -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); -@@ -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: -@@ -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); -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; - -- if (!capable(CAP_SYS_ADMIN)) -+ if (!cfs_capable(CFS_CAP_SYS_ADMIN)) - RETURN(-EPERM); - - OBD_ALLOC_PTR(oqctl); -@@ -900,7 +900,7 @@ static int ll_dir_ioctl(struct inode *in - struct if_quotacheck *check; - int rc; - -- if (!capable(CAP_SYS_ADMIN)) -+ if (!cfs_capable(CFS_CAP_SYS_ADMIN)) - RETURN(-EPERM); - - OBD_ALLOC_PTR(check); -@@ -956,13 +956,13 @@ static int ll_dir_ioctl(struct inode *in - case Q_QUOTAOFF: - case Q_SETQUOTA: - case Q_SETINFO: -- if (!capable(CAP_SYS_ADMIN)) -+ if (!cfs_capable(CFS_CAP_SYS_ADMIN)) - GOTO(out_quotactl, rc = -EPERM); - break; - case Q_GETQUOTA: - if (((type == USRQUOTA && current->euid != id) || - (type == GRPQUOTA && !in_egroup_p(id))) && -- !capable(CAP_SYS_ADMIN)) -+ !cfs_capable(CFS_CAP_SYS_ADMIN)) - GOTO(out_quotactl, rc = -EPERM); - - /* XXX: dqb_valid is borrowed as a flag to mark that -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; - -- if (!capable (CAP_SYS_ADMIN)) -+ if (!cfs_capable(CFS_CAP_SYS_ADMIN)) - RETURN(-EPERM); - - rc = copy_from_user(&ucreatp, (struct ll_recreate_obj *)arg, -@@ -2134,7 +2134,7 @@ static int ll_lov_setea(struct inode *in - int rc; - ENTRY; - -- if (!capable (CAP_SYS_ADMIN)) -+ if (!cfs_capable(CFS_CAP_SYS_ADMIN)) - RETURN(-EPERM); - - OBD_ALLOC(lump, lum_size); -@@ -3146,10 +3146,10 @@ check_groups: - check_capabilities: - if (!(mask & MAY_EXEC) || - (inode->i_mode & S_IXUGO) || S_ISDIR(inode->i_mode)) -- if (capable(CAP_DAC_OVERRIDE)) -+ if (cfs_capable(CFS_CAP_DAC_OVERRIDE)) - return 0; - -- if (capable(CAP_DAC_READ_SEARCH) && ((mask == MAY_READ) || -+ if (cfs_capable(CFS_CAP_DAC_READ_SEARCH) && ((mask == MAY_READ) || - (S_ISDIR(inode->i_mode) && !(mask & MAY_WRITE)))) - return 0; - -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)) { -- if (current->fsuid != inode->i_uid && !capable(CAP_FOWNER)) -+ if (current->fsuid != inode->i_uid && -+ !cfs_capable(CFS_CAP_FOWNER)) - RETURN(-EPERM); - } - -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); - -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 - * dirty the page */ -@@ -2038,7 +2038,7 @@ static int ll_file_oig_pages(struct inod - if (rc) - RETURN(rc); - brw_flags = OBD_BRW_SRVLOCK; -- if (capable(CAP_SYS_RESOURCE)) -+ if (cfs_capable(CFS_CAP_SYS_RESOURCE)) - brw_flags |= OBD_BRW_NOQUOTA; - - for (i = 0; i < numpages; i++) { -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; -- if (xattr_type == XATTR_TRUSTED_T && !capable(CAP_SYS_ADMIN)) -+ if (xattr_type == XATTR_TRUSTED_T && !cfs_capable(CFS_CAP_SYS_ADMIN)) - return -EPERM; - if (xattr_type == XATTR_OTHER_T) - return -EOPNOTSUPP; -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(); - 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, 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; - -@@ -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; - 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) - { - 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 - -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) - { -- __u32 cap; -- int rc; -+ int raised, rc; - ENTRY; - - if (!ctxt) { -@@ -216,10 +215,12 @@ int llog_add(struct llog_ctxt *ctxt, str - } - - CTXT_CHECK_OP(ctxt, add, -EOPNOTSUPP); -- 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; -+ if (!raised) -+ cfs_cap_lower(CFS_CAP_SYS_RESOURCE); - RETURN(rc); - } - EXPORT_SYMBOL(llog_add); -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; -- if (!in_group_p(oa->o_gid) && !capable(CAP_FSETID)) -+ if (!in_group_p(oa->o_gid) && !cfs_capable(CFS_CAP_FSETID)) - oa->o_mode &= ~S_ISGID; - } - if (ia_valid & ATTR_UID) { -@@ -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; -- if (!in_group_p(oa->o_gid) && !capable(CAP_FSETID)) -+ if (!in_group_p(oa->o_gid) && !cfs_capable(CFS_CAP_FSETID)) - attr->ia_mode &= ~S_ISGID; - } - if (valid & OBD_MD_FLUID) { -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) { - case OBD_IOC_CREATE: /* may create echo object */ -- if (!capable (CAP_SYS_ADMIN)) -+ if (!cfs_capable(CFS_CAP_SYS_ADMIN)) - GOTO (out, rc = -EPERM); - - rc = echo_create_object (obd, 1, &data->ioc_obdo1, -@@ -1157,7 +1157,7 @@ echo_client_iocontrol(unsigned int cmd, - GOTO(out, rc); - - case OBD_IOC_DESTROY: -- 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); - if (rc == 0) { -@@ -1184,7 +1184,7 @@ echo_client_iocontrol(unsigned int cmd, - GOTO(out, rc); - - case OBD_IOC_SETATTR: -- 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); -@@ -1199,7 +1199,7 @@ echo_client_iocontrol(unsigned int cmd, - GOTO(out, rc); - - case OBD_IOC_BRW_WRITE: -- if (!capable (CAP_SYS_ADMIN)) -+ if (!cfs_capable(CFS_CAP_SYS_ADMIN)) - GOTO (out, rc = -EPERM); - - rw = OBD_BRW_WRITE; -@@ -1218,7 +1218,7 @@ echo_client_iocontrol(unsigned int cmd, - GOTO(out, rc); - - case ECHO_IOC_SET_STRIPE: -- if (!capable (CAP_SYS_ADMIN)) -+ if (!cfs_capable(CFS_CAP_SYS_ADMIN)) - GOTO (out, rc = -EPERM); - - if (data->ioc_pbuf1 == NULL) { /* unset */ -@@ -1235,7 +1235,7 @@ echo_client_iocontrol(unsigned int cmd, - GOTO (out, rc); - - case ECHO_IOC_ENQUEUE: -- if (!capable (CAP_SYS_ADMIN)) -+ if (!cfs_capable(CFS_CAP_SYS_ADMIN)) - GOTO (out, rc = -EPERM); - - rc = echo_client_enqueue(exp, &data->ioc_obdo1, -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() */ -- if ((dentry->d_inode->i_uid != current->fsuid && !capable(CAP_FOWNER))|| -- IS_APPEND(dentry->d_inode) || IS_IMMUTABLE(dentry->d_inode)) -+ if ((dentry->d_inode->i_uid != current->fsuid && -+ !cfs_capable(CFS_CAP_FOWNER)) || IS_APPEND(dentry->d_inode) || -+ IS_IMMUTABLE(dentry->d_inode)) - GOTO(out, rc = -EPERM); - - /* NOTE: This might need to go outside i_mutex, though it isn't clear if -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); - -- 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.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) -- cap_raise(current->cap_effective, CAP_SYS_RESOURCE); -+ cfs_cap_raise(CFS_CAP_SYS_RESOURCE); - else -- cap_lower(current->cap_effective, CAP_SYS_RESOURCE); -+ cfs_cap_lower(CFS_CAP_SYS_RESOURCE); - - RETURN(0); - } -- Lustre Debian Packaging _______________________________________________ Pkg-lustre-svn-commit mailing list Pkg-lustre-svn-commit@lists.alioth.debian.org http://lists.alioth.debian.org/mailman/listinfo/pkg-lustre-svn-commit