[LU-8561] Redundant check in osd_mount Created: 29/Aug/16  Updated: 05/Oct/16  Resolved: 05/Oct/16

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

Type: Bug Priority: Minor
Reporter: Oleg Drokin Assignee: Jinshan Xiong (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

smatch reports that:

1030	1030	 err:
1031	1031	 »       if (rc) {
1032	1032	 »       »       if (o->od_os)
Misc Code Checks Robot (Gatekeeper helper)	warn: osd_mount():variable dereferenced before check 'o->od_os' (see line …

Basically the problem here is o->od_os is always true.

While it's possible to convert this to LASSERT, I wonder if we should just drop it altogether since there'd be crash either way.

This was exposed by landing of LU-4865 patch, even though the problem actually was there before it



 Comments   
Comment by Gerrit Updater [ 31/Aug/16 ]

Jinshan Xiong (jinshan.xiong@intel.com) uploaded a new patch: http://review.whamcloud.com/22245
Subject: LU-8561 osd-zfs: make smatch happy
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: a6e4d1c85091537e5bfbd650e5b6fa2b997f4769

Comment by Gerrit Updater [ 05/Oct/16 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/22245/
Subject: LU-8561 osd-zfs: make smatch happy
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 6c747f6cc18e0e89d3d90e9c8f0de1994776871f

Comment by Peter Jones [ 05/Oct/16 ]

Landed for 2.9

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