[LU-13115] always check object existence after mo_xattr_get() Created: 07/Jan/20  Updated: 18/Jan/20  Resolved: 18/Jan/20

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

Type: Bug Priority: Major
Reporter: Mikhail Pershin Assignee: Mikhail Pershin
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
is related to LU-12895 review-dne-selinux sanity test_185a: ... Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

There is specific case with lu_object LOHA_EXISTS flag in DNE environment when it can be dropped if remote object was found non-existent (deleted most likely?) which may cause problems in current MDT code paths.

Without DNE LOHA_EXISTS is never dropped being set, when object is deleted it is just marked as destroyed (by LU_OBJECT_HEARD_BANSHEE flag). Therefore object being once checked for existence is always 'exists' in rest of code at least until lu_object_put() and requires no extra checks with lu_object_exists()

With DNE the LOHA_EXISTS flag can be dropped during osp_xattr_get(). I am not sure if that was right decision, probably we have to keep the same semantic and keep LOHA_EXISTS always but just mark object as non-existent remotely, or use LU_OBJECT_HEARD_BANSHEE also like for local objects. Anyway, with DNE it is possible that existent object can become non-existent after mo_xattr_get() call. Therefore a return code of mo_xattr_get() must always be handled and checked for -ENOENT or lu_object_exists() must be performed right after that call.

The mdt_pack_secctx_in_reply() ignores all return code silently and that opens door for lu_object_exists() assertions in further code path. While this function is about the optional XATTR getting it is still important to check -ENOENT case because it might change object state.

Also there can be other places in code where result of mo_xattr_get() is not handled and this remains obscured for code writers. I wonder how to make people know about that mo_xattr_get() specific, probably osp_xattr_get() should be revised to don't drop LOHA_EXISTS flag but mark object as non-existent remotely.



 Comments   
Comment by Gerrit Updater [ 07/Jan/20 ]

Mike Pershin (mpershin@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/37148
Subject: LU-13115 mdt: handle mdt_pack_sectx_in_reply() errors
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: d0ea6ecb63e565c41e28e0f22d1b4ef41617bae9

Comment by Gerrit Updater [ 18/Jan/20 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/37148/
Subject: LU-13115 mdt: handle mdt_pack_sectx_in_reply() errors
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 732ed22bdb6ca6abe8896f24e7ba46eea3fc379d

Comment by Peter Jones [ 18/Jan/20 ]

Landed for 2.14

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