Details
-
Bug
-
Resolution: Fixed
-
Major
-
None
-
None
-
3
-
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.
Attachments
Issue Links
- is related to
-
LU-12895 review-dne-selinux sanity test_185a: lu_object_attr()) ASSERTION( ((o)->lo_header->loh_attr & LOHA_EXISTS) != 0 ) failed
-
- Resolved
-
Activity
Fix Version/s | New: Lustre 2.14.0 [ 14490 ] | |
Resolution | New: Fixed [ 1 ] | |
Status | Original: In Progress [ 3 ] | New: Resolved [ 5 ] |
Status | Original: Open [ 1 ] | New: In Progress [ 3 ] |
Description |
Original:
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 {{md_xattr_get()}} call. Therefore a return code of {{md_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 md_xattr_get() is not handled and this remains obscured for code writers. I wonder how to make people know about that {{md_xattr_get()}} specific, probably {{osp_xattr_get()}} should be revised to don't drop {{LOHA_EXISTS}} flag but mark object as non-existent remotely. |
New:
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. |
Summary | Original: always check object existence after md_xattr_get() | New: always check object existence after mo_xattr_get() |
Description |
Original:
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 existent 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 md_xattr_get() call. Therefore a return code of md_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 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 md_xattr_get() is not handled and this remains obscured for code writers. I wonder how to make people know about that {{md_xattr_get()}} specific, probably {{osp_xattr_get()}} should be revised to don't drop {{LOHA_EXISTS}} flag but mark object as non-existent remotely. |
New:
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 {{md_xattr_get()}} call. Therefore a return code of {{md_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 md_xattr_get() is not handled and this remains obscured for code writers. I wonder how to make people know about that {{md_xattr_get()}} specific, probably {{osp_xattr_get()}} should be revised to don't drop {{LOHA_EXISTS}} flag but mark object as non-existent remotely. |
Landed for 2.14