[LU-14494] check object existence in mdt_close_handle_layouts() Created: 05/Mar/21  Updated: 28/Apr/21  Resolved: 30/Mar/21

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.15.0

Type: Bug Priority: Minor
Reporter: John Hammond Assignee: John Hammond
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Duplicate
Related
is related to LU-14493 return only existing objects from mdt... Open
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

In mdt_close_handle_layouts() the client supplied FID may not identify an existing object. So we should check before calling lu_object_attr().



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

https://review.whamcloud.com/#/c/41905/

EX-14494 mdt: check object exists in mdt_close_handle_layouts()

In mdt_close_handle_layouts() the client supplied FID may not identify
an existing object. So check for this before calling lu_object_attr().

Signed-off-by: John L. Hammond <jhammond@whamcloud.com>
Change-Id: Ib1710ca4bf7587e0496b3a37a2afb65f81250455

Comment by Gerrit Updater [ 30/Mar/21 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/41905/
Subject: LU-14494 mdt: check object exists in mdt_close_handle_layouts()
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 075bea805efe8a7ef1a3aabd8dd2c166bb52115b

Comment by Peter Jones [ 30/Mar/21 ]

Landed for 2.15

Comment by Andreas Dilger [ 30/Mar/21 ]

Alex,
I think John has raised this issue elsewhere (though I can't find it), so I will do it again here - should we remove this LASSERT(LOHA_EXISTS) and just return -ENOENT in this case? Jira is littered with tickets where the LOHA_EXISTS assertion is triggered (41 different tickets at last count, I just hit another one in LFSCK over the weekend), and in many cases the solution is just to add extra code to check that the object does not exist before calling lu_object_attr->lu_object_exists(), which isn't really simplifying the code, and causes customer outages. I think this LASSERT has outlived its usefulness if we are adding lines of code just to avoid triggering the LASSERT.

Comment by John Hammond [ 30/Mar/21 ]

LU-14493

Comment by Alex Zhuravlev [ 30/Mar/21 ]

Andreas, I'm not really a defender of that LASSERT(), I didn't introduce that at least but I see some logic for that assertion - there is no point to ask for attributes on non-existing object (which has no attributes by definition). OK, say we change lu_object_attr() to return -ENOENT, but then we have to check/fix >60 callers as normally they do like:

if (S_ISDIR(mdd_object_type(obj)))

would that be really different from checking all the places to add if (*_object_exists())... ?
I think at some point John suggested to have a wrapper that checks for existance internally and use that everywhere except few places when we can expect non-existing object as a valid case?

Comment by John Hammond [ 30/Mar/21 ]

LU-14493

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