[LU-14145] protect cli->cl_import with with_imp_locked() Created: 20/Nov/20 Updated: 21/Nov/20 |
|
| Status: | Open |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Jian Yu | Assignee: | Neil Brown |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||
| Severity: | 3 | ||||||||||||
| Rank (Obsolete): | 9223372036854775807 | ||||||||||||
| Description |
|
Protect cli->cl_import with with_imp_locked(): /* You must use these macros when you want to refer to * the import in a client obd_device for a lprocfs entry */ #define with_imp_locked(__obd, __imp, __rc) \ for (down_read(&(__obd)->u.cli.cl_sem), \ __imp = (__obd)->u.cli.cl_import, \ __rc = __imp ? 0 : -ENODEV; \ __imp ? 1 : (up_read(&(__obd)->u.cli.cl_sem), 0); \ __imp = NULL) |
| Comments |
| Comment by James A Simmons [ 20/Nov/20 ] |
|
Note Neil has a patch for this at https://review.whamcloud.com/#/c/39595/ |
| Comment by Jian Yu [ 21/Nov/20 ] |
|
Thank you James.
ocd = &cli->cl_import->imp_connect_data;
|
| Comment by James A Simmons [ 21/Nov/20 ] |
|
His patch does improve things including handling nested locking, but I did mention in the patch's review other things that need to be covered such as imp_connect_data and imp_generation access as well. Also lov_iocontrol() does no locking for cl_import access. So another patch is needed. |