#define DEBUG_SUBSYSTEM S_SEC
#include <linux/user_namespace.h>
-#ifdef HAVE_UIDGID_HEADER
-# include <linux/uidgid.h>
-#endif
+#include <linux/uidgid.h>
#include <linux/crypto.h>
#include <linux/key.h>
newctx, newctx->cc_flags);
set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(msecs_to_jiffies(MSEC_PER_SEC));
+ schedule_timeout(cfs_time_seconds(1));
} else if (unlikely(test_bit(PTLRPC_CTX_UPTODATE_BIT, &newctx->cc_flags)
== 0)) {
/*
}
static
-int ctx_refresh_timeout(void *data)
+int ctx_refresh_timeout(struct ptlrpc_request *req)
{
- struct ptlrpc_request *req = data;
int rc;
/* conn_cnt is needed in expire_one_request */
}
static
-void ctx_refresh_interrupt(void *data)
+void ctx_refresh_interrupt(struct ptlrpc_request *req)
{
- struct ptlrpc_request *req = data;
spin_lock(&req->rq_lock);
req->rq_intr = 1;
{
struct ptlrpc_cli_ctx *ctx = req->rq_cli_ctx;
struct ptlrpc_sec *sec;
- struct l_wait_info lwi;
int rc;
ENTRY;
req->rq_restart = 0;
spin_unlock(&req->rq_lock);
- lwi = LWI_TIMEOUT_INTR(msecs_to_jiffies(timeout * MSEC_PER_SEC),
- ctx_refresh_timeout,
- ctx_refresh_interrupt, req);
- rc = l_wait_event(req->rq_reply_waitq, ctx_check_refresh(ctx), &lwi);
+ if (wait_event_idle_timeout(req->rq_reply_waitq,
+ ctx_check_refresh(ctx),
+ cfs_time_seconds(timeout)) == 0) {
+ rc = -ETIMEDOUT;
+ if (!ctx_refresh_timeout(req) &&
+ l_wait_event_abortable(req->rq_reply_waitq,
+ ctx_check_refresh(ctx))
+ == -ERESTARTSYS) {
+ rc = -EINTR;
+ ctx_refresh_interrupt(req);
+ }
+ }
/*
* following cases could lead us here:
rc = do_cli_unwrap_reply(early_req);
if (rc) {
DEBUG_REQ(D_ADAPTTO, early_req,
- "error %d unwrap early reply", rc);
+ "unwrap early reply: rc = %d", rc);
GOTO(err_ctx, rc);
}
switch (req->rq_sp_from) {
case LUSTRE_SP_CLI:
if (req->rq_auth_usr_mdt || req->rq_auth_usr_ost) {
+ /* The below message is checked in sanity-sec test_33 */
DEBUG_REQ(D_ERROR, req, "faked source CLI");
svc_rc = SECSVC_DROP;
}
break;
case LUSTRE_SP_MDT:
if (!req->rq_auth_usr_mdt) {
+ /* The below message is checked in sanity-sec test_33 */
DEBUG_REQ(D_ERROR, req, "faked source MDT");
svc_rc = SECSVC_DROP;
}
break;
case LUSTRE_SP_OST:
if (!req->rq_auth_usr_ost) {
+ /* The below message is checked in sanity-sec test_33 */
DEBUG_REQ(D_ERROR, req, "faked source OST");
svc_rc = SECSVC_DROP;
}
case LUSTRE_SP_MGC:
if (!req->rq_auth_usr_root && !req->rq_auth_usr_mdt &&
!req->rq_auth_usr_ost) {
+ /* The below message is checked in sanity-sec test_33 */
DEBUG_REQ(D_ERROR, req, "faked source MGC/MGS");
svc_rc = SECSVC_DROP;
}