From 35a08d8451271e1c0f0574742e9b226e7df6a3bd Mon Sep 17 00:00:00 2001 From: vitaly Date: Mon, 15 Sep 2008 18:30:59 +0000 Subject: [PATCH] Branch b1_8_gate b=15949 i=adilger i=shadow --- lustre/obdclass/llog_obd.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lustre/obdclass/llog_obd.c b/lustre/obdclass/llog_obd.c index d03b637..77163a8 100644 --- a/lustre/obdclass/llog_obd.c +++ b/lustre/obdclass/llog_obd.c @@ -206,8 +206,7 @@ int llog_add(struct llog_ctxt *ctxt, struct llog_rec_hdr *rec, 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, struct llog_rec_hdr *rec, } 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); -- 1.8.3.1