Whamcloud - gitweb
Drop security ctxt when umount, for avoiding ldlm_revoke_export_locks
authorfanyong <fanyong>
Wed, 11 Oct 2006 08:48:12 +0000 (08:48 +0000)
committerfanyong <fanyong>
Wed, 11 Oct 2006 08:48:12 +0000 (08:48 +0000)
accessing freed resource.

lustre/include/lustre_sec.h
lustre/ptlrpc/import.c
lustre/ptlrpc/sec.c
lustre/ptlrpc/service.c

index 2065e2f..e316eae 100644 (file)
@@ -458,6 +458,7 @@ void sptlrpc_import_put_sec(struct obd_import *imp);
 int sptlrpc_import_check_ctx(struct obd_import *imp);
 void sptlrpc_import_flush_root_ctx(struct obd_import *imp);
 void sptlrpc_import_flush_my_ctx(struct obd_import *imp);
+void sptlrpc_import_flush_all_ctx(struct obd_import *imp);
 int  sptlrpc_req_get_ctx(struct ptlrpc_request *req);
 void sptlrpc_req_put_ctx(struct ptlrpc_request *req);
 int  sptlrpc_req_refresh_ctx(struct ptlrpc_request *req, long timeout);
index 46bb13c..9c323b1 100644 (file)
@@ -203,6 +203,7 @@ void ptlrpc_invalidate_import(struct obd_import *imp)
                        atomic_read(&imp->imp_inflight));
 
         obd_import_event(imp->imp_obd, imp, IMP_EVENT_INVALIDATE);
+        sptlrpc_import_flush_all_ctx(imp);
 }
 
 /* unset imp_invalid */
index 00dcec6..b2b1a34 100644 (file)
@@ -1408,6 +1408,15 @@ void sptlrpc_import_flush_my_ctx(struct obd_import *imp)
 }
 EXPORT_SYMBOL(sptlrpc_import_flush_my_ctx);
 
+void sptlrpc_import_flush_all_ctx(struct obd_import *imp)
+{
+        if (imp == NULL || imp->imp_sec == NULL)
+                return;
+
+        ctx_cache_flush(imp->imp_sec, -1, 0, 1);
+}
+EXPORT_SYMBOL(sptlrpc_import_flush_all_ctx);
+
 int sptlrpc_cli_install_rvs_ctx(struct obd_import *imp,
                                 struct ptlrpc_cli_ctx *ctx)
 {
index d21a54c..77198b6 100644 (file)
@@ -583,6 +583,10 @@ ptlrpc_server_handle_request(struct ptlrpc_service *svc,
                                     svc->srv_n_active_reqs);
         }
 
+        /* go through security check/transform */
+        request->rq_auth_uid = INVALID_UID;
+        request->rq_auth_mapped_uid = INVALID_UID;
+
         rc = sptlrpc_svc_unwrap_request(request);
         switch (rc) {
         case SECSVC_OK: