[LU-14493] return only existing objects from mdt_object_find() Created: 05/Mar/21  Updated: 30/Mar/21

Status: Open
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: John Hammond Assignee: Mikhail Pershin
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Related
is related to LU-14494 check object existence in mdt_close_h... Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

In almost every place where we call mdt_object_find() we expect that the object exists. So lets check mdt_object_exists() before returning from mdt_object_find() and return ERR_PTR(-ENOENT) if it doesn't.

For the few remaining cases where it's OK for the object not to exist. We should have a new function. This save typing and prevent failed ASSERTION( ((o)>lo_header>loh_attr & LOHA_EXISTS) != 0 ) assertions in places where people forgot to check if the object exists before calling lu_object_attr().

One way to do this would be to rename mdt_object_find() to mdt_object_find_nx() and then create a new mdt_object_find() that calls mdt_object_find_nx(), does the check, returns existing objects, puts non-existing objects, and returns appropriately.



 Comments   
Comment by John Hammond [ 05/Mar/21 ]

tappro can you take a look at this?

Generated at Sat Feb 10 03:10:14 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.