[LU-3611] Wrong order of locking and allocating memory in mgs_pool_cmd() Created: 22/Jul/13  Updated: 13/Sep/13  Resolved: 13/Sep/13

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.4.1, Lustre 2.5.0
Fix Version/s: Lustre 2.4.1, Lustre 2.5.0

Type: Bug Priority: Minor
Reporter: Li Xi (Inactive) Assignee: Keith Mannthey (Inactive)
Resolution: Fixed Votes: 0
Labels: mq313, patch

Severity: 3
Rank (Obsolete): 9280

 Description   

In function mgs_pool_cmd(), fsdb_mutex is locked and then mti is allocated. It is not correct and will cause problem if memory allocating fails and leaves fsdb_mutex locked. Following is the codes.

mutex_lock(&fsdb->fsdb_mutex);

if (canceled_label != NULL)

{ OBD_ALLOC_PTR(mti); if (mti == NULL) GOTO(out_cancel, rc = -ENOMEM); }

 Comments   
Comment by Li Xi (Inactive) [ 22/Jul/13 ]

Here is the patch that fixes the problem.
http://review.whamcloud.com/7065

Comment by Keith Mannthey (Inactive) [ 22/Jul/13 ]

This fix will also be needed on Master.

Comment by Peter Jones [ 13/Sep/13 ]

Landed for 2.4.1 and 2.5

Generated at Sat Feb 10 01:35:24 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.