[LU-7077] Pointer 'hash' returned from call to function 'cfs_hash_getref' may be NULL and will be dereferenced. Created: 01/Sep/15  Updated: 20/Nov/15  Resolved: 20/Nov/15

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

Type: Bug Priority: Minor
Reporter: Dmitry Eremin (Inactive) Assignee: Bob Glossman (Inactive)
Resolution: Fixed Votes: 0
Labels: kw

Issue Links:
Related
is related to LU-6840 update memory reply data in DNE updat... Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

lustre/obdclass/genops.c:944

hash = cfs_hash_getref(exp->exp_obd->obd_gen_hash);
cfs_hash_del(hash, &ted->ted_lcd->lcd_generation,
	     &exp->exp_gen_hash);
cfs_hash_putref(hash);
struct cfs_hash *cfs_hash_getref(struct cfs_hash *hs)
{
	if (atomic_inc_not_zero(&hs->hs_refcount))
		return hs;
	return NULL;
}


 Comments   
Comment by Dmitry Eremin (Inactive) [ 01/Sep/15 ]

This was introduced in http://review.whamcloud.com/15576

Comment by Gerrit Updater [ 17/Sep/15 ]

Bob Glossman (bob.glossman@intel.com) uploaded a new patch: http://review.whamcloud.com/16473
Subject: LU-7077 target: avoid using possible error return NULL pointer
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: fa02a91e622631096b83021d31b0aa6781950662

Comment by Di Wang [ 24/Sep/15 ]

Dmitry, could you please comment on http://review.whamcloud.com/#/c/16473/1 ? thanks

Comment by Dmitry Eremin (Inactive) [ 28/Sep/15 ]

This issue was found by static analysis checker. So, we didn't get a real crash because of it. The question is can we gracefully handle errors or not.

Comment by Gerrit Updater [ 19/Nov/15 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/16473/
Subject: LU-7077 target: avoid using possible error return NULL pointer
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: a7eface85ea2d2aa6198681264b082a0244855d4

Comment by Joseph Gmitter (Inactive) [ 20/Nov/15 ]

Landed for 2.8

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