[LU-2853] osc send list corruption Created: 22/Feb/13  Updated: 22/Feb/13  Resolved: 22/Feb/13

Status: Closed
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.0.0, Lustre 2.1.0, Lustre 2.2.0, Lustre 2.3.0, Lustre 2.4.0
Fix Version/s: None

Type: Bug Priority: Critical
Reporter: Alexey Lyashkov Assignee: Bruno Faccini (Inactive)
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates LU-2797 GPF in osc_send_oap_rpc Resolved
Severity: 3
Rank (Obsolete): 6904

 Description   

after landing
Author: jxiong <jxiong> 2009-08-28 06:05:01
Committer: jxiong <jxiong> 2009-08-28 06:05:01
Parent: f907343dc34ac32bde1a56030d9994fa024a2874 (b=19955)
Child: 2b87d9a6d9eefab2209030b167df7998c3d4c1d0 (b=20131)
Precedes: v1_10_0_32, v1_9_251, v1_9_260, v1_9_270, v1_9_280, v1_9_290

b=18881
r=wangdi,eric.mei

we have an unprotected call for loi_list_maint

@@ -2523,7 +2532,7 @@ osc_send_oap_rpc(const struct lu_env *env, struct client_obd *cli,
req = osc_build_req(env, cli, &rpc_list, page_count, cmd);
if (IS_ERR(req))

{ LASSERT(list_empty(&rpc_list)); - /* loi_list_maint(cli, loi); */ + loi_list_maint(cli, loi); RETURN(PTR_ERR(req)); }

which modify a loi list without holding a cl_loi_list_lock - so open for races.
that race may caused LU-2797.



 Comments   
Comment by Alexey Lyashkov [ 22/Feb/13 ]
      req = osc_build_req(env, cli, &rpc_list, page_count, cmd);
        if (IS_ERR(req)) {
                LASSERT(list_empty(&rpc_list));
-                /* loi_list_maint(cli, loi); */
+                loi_list_maint(cli, loi);
                RETURN(PTR_ERR(req));
        }
Comment by Bruno Faccini (Inactive) [ 22/Feb/13 ]

Since I am in charge of LU-2797, I am taking this one too.
Alexey, thank's already to point this!

Comment by Bruno Faccini (Inactive) [ 22/Feb/13 ]

But in fact looking into the code, I think it is more complex, seems to me that it is assumed we also need to return back to osc_check_rpcs() with cl_loi_list_lock set anyway.
Thus the fix would better look like to add a client_obd_list_lock(&cli->cl_loi_list_lock) before loi_list_maint() call.

Comment by Jodi Levi (Inactive) [ 22/Feb/13 ]

Duplicate of LU-2797

Generated at Sat Feb 10 01:28:46 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.