[LU-11755] Remove redundant LASSERT() in ns_is_{client,server}() Created: 11/Dec/18  Updated: 20/Jun/19  Resolved: 04/Jan/19

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.11.0
Fix Version/s: Lustre 2.13.0, Lustre 2.12.3

Type: Bug Priority: Trivial
Reporter: Nikitas Angelinas Assignee: Nikitas Angelinas
Resolution: Fixed Votes: 0
Labels: patch

Issue Links:
Related
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

In ns_is_{client,server}(), (ns->ns_client == LDLM_NAMESPACE_CLIENT || ns->ns_client == LDLM_NAMESPACE_SERVER) implies that (!(ns->ns_client & ~(LDLM_NAMESPACE_CLIENT |
LDLM_NAMESPACE_SERVER))) is also true, so the latter LASSERT() could be removed from ns_is_{client,server}().

 

This might be an inconsequential issue. I have not checked if gcc optimizes-out one of the LASSERT()s.



 Comments   
Comment by Nikitas Angelinas [ 11/Dec/18 ]

Sorry, I meant to say "if gcc optimizes-out the first LASSERT()", in the description.

Comment by Gerrit Updater [ 11/Dec/18 ]

Nikitas Angelinas (nangelinas@cray.com) uploaded a new patch: https://review.whamcloud.com/33822
Subject: LU-11755 ldlm: remove LASSERT() in ns_is_

{client,server}

()
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 2fff402f6bd8234f4598ba05b7323939afbd52d0

Comment by Gerrit Updater [ 04/Jan/19 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/33822/
Subject: LU-11755 ldlm: remove LASSERT() in ns_is_

{client,server}

()
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 0af247b17619f586702b0ad37f0796bdf783b11c

Comment by Peter Jones [ 04/Jan/19 ]

Landed for 2.13

Comment by Gu Zheng (Inactive) [ 22/Apr/19 ]

Hi  Nikitas Angelinas,

This ticket was opened as a BUG, and patch has link to Cray-bug-id: LUS-6762 (Sorry that I can't access it),  so did you really hit similar bugs? or patch is only a cleanup.

Comment by Nikitas Angelinas [ 23/Apr/19 ]

Hi Gu Zheng,

Sorry, I may have opened this as the wrong type of ticket. We did not hit any bugs related to this; it is only a cleanup. Should it be an improvement instead of a bug ticket?

Comment by Gu Zheng (Inactive) [ 23/Apr/19 ]

Hi  @Nikitas,

I see.

The ticket is closed, just let it go.

I pinged you for that, because we hit a bug on this LASSERT(you patch removed), it's really strange, you know ns->ns_client is only used for namespace type check, and it'll never be changed once inited (new ldlm_namespace), we never hit similar problem before.

Comment by Gerrit Updater [ 11/Jun/19 ]

Minh Diep (mdiep@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/35193
Subject: LU-11755 ldlm: remove LASSERT() in ns_is_

{client,server}

()
Project: fs/lustre-release
Branch: b2_12
Current Patch Set: 1
Commit: d31110348f4f264cc3c04a7ada972b35cb01c5d8

Comment by Gerrit Updater [ 20/Jun/19 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/35193/
Subject: LU-11755 ldlm: remove LASSERT() in ns_is_

{client,server}

()
Project: fs/lustre-release
Branch: b2_12
Current Patch Set:
Commit: 19aefacda4623fb34b09f499ecf087fcb7b968f5

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