[LU-10877] dt_locate_at reference leak Created: 04/Apr/18  Updated: 15/Apr/18  Resolved: 15/Apr/18

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.9.0, Lustre 2.10.0, Lustre 2.11.0
Fix Version/s: Lustre 2.12.0

Type: Bug Priority: Critical
Reporter: Alexey Lyashkov Assignee: WC Triage
Resolution: Fixed Votes: 0
Labels: None
Environment:

any. Test from LU-9699


Issue Links:
Related
is related to LU-1301 MGS over OSD Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

commit f6d6a552398eb1e65857d9bf1afaaf98c8dc1a79 have rewrite a dt_locate_at function to different device tree handling, and this change introduce an object reference leak.

+       struct lu_object *lo, *n;
+       ENTRY;
+
+       lo = lu_object_find_at(env, top_dev, fid, NULL);
+       if (IS_ERR(lo))
+               return (void *)lo;
+
+       LASSERT(lo != NULL);
+
+       cfs_list_for_each_entry(n, &lo->lo_header->loh_layers, lo_linkage) {
+               if (n->lo_dev == &dev->dd_lu_dev)
+                       return container_of0(n, struct dt_object, do_lu);
+       }
+       return ERR_PTR(-ENOENT);

if some object not in expected tree we have return an ENOENT without an object reference release. It will cause a panic on unmount.



 Comments   
Comment by Gerrit Updater [ 04/Apr/18 ]

Alexey Lyashkov (c17817@cray.com) uploaded a new patch: https://review.whamcloud.com/31870
Subject: LU-10877 lu: fix reference leak
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 0f829f6bb358f61db7d7275494628fce4b400691

Comment by Gerrit Updater [ 14/Apr/18 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/31870/
Subject: LU-10877 lu: fix reference leak
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: fd669eba19210edd3a011d6862fda96383453cc3

Comment by Peter Jones [ 15/Apr/18 ]

Landed for 2.12

Generated at Sat Feb 10 02:38:58 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.