[LU-10657] New static analysis issues in v2_10_58_0-16-g21e3977 Created: 12/Feb/18  Updated: 30/Aug/23  Resolved: 03/Mar/18

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

Type: Bug Priority: Major
Reporter: Dmitry Eremin (Inactive) Assignee: Zhenyu Xu
Resolution: Fixed Votes: 0
Labels: kw

Issue Links:
Related
is related to LU-4629 Issues found by static analysis tools Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

Found 1 new static analysis issues in v2_10_58_0-16-g21e3977:

  1. Resource leak
    • lustre/utils/lfs.c: in mirror_split, Resource acquired to 'fd' at line 1690 may be lost here.

TRACEBACK:

  • A condition which occurs, leading to the defect
    lfs.c:1683: rc==LLAPI_LAYOUT_ITER_CONT is false
  • An event which alters the program's state, leading to the defect
    lfs.c:1690: Resource is acquired: 'fd' in the call to 'open'
  • A condition which occurs, leading to the defect
    lfs.c:1691: fd<0 is false
  • A condition which occurs, leading to the defect
    lfs.c:1721: rc<0 is true
  • An event which alters the program's state, leading to the defect
    lfs.c:1788: Resource is lost: 'fd'

The same happens with all 'goto free_layout;' after lfs.c:1697 line.

The list of commits since the previous build v2_10_57_0-88-g8059dbb:

21e3977 -LU-10286- mdt: deny 2.10 clients to open mirrored files
b8e87b5 LU-10560 llite: remove extra headers from rw26.c
aae9a90 LU-10560 llite: remove extra headers from llite_mmap.c
45ad1a7 -LU-10536- build: add path for libnvpair to zfslib
4fabc57 -LU-10580- lfsck: GPF in lfsck_namespace_repair_dirent
db25bdd -LU-9466- tests: Error message for empty "error" calls
defbc7d -LU-10508- utils: use callvpe() in lustre_rsync
7b980e1 -LU-10507- tests: use {save,restore}
_layout() in test
4b5206bc -LU-6353- contrib: Remove wireshark plugin
96fbf09 LU-10347 tests: suspend the copytool in sanity-hsm/test_252
043f597 -LU-10364- test: Add version check to test_255b
873c843 -LU-9664- hsm: protect cdt_state
99420a1 LU-9474 tests: fix quoting in stack_trap
dbc73c2 LU-9019 lnd: remove remaining cfs_time wrappers
23b2d47 -LU-10420- flr: split a mirror from mirrored file
27116ee -LU-10394- lnd: default to using MEM_REG
116c51f New tag 2.10.58


 Comments   
Comment by Joseph Gmitter (Inactive) [ 23/Feb/18 ]

Hi Bobijam,

Can you please look into this?

Thanks.
Joe

Comment by Gerrit Updater [ 24/Feb/18 ]

Bobi Jam (bobijam@hotmail.com) uploaded a new patch: https://review.whamcloud.com/31410
Subject: LU-10657 utils: fd leak in mirror_split()
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 7daecd1c02ea0316fccf3649448171de9f1913d1

Comment by Gerrit Updater [ 03/Mar/18 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/31410/
Subject: LU-10657 utils: fd leak in mirror_split()
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: c593dd0b3c758f58a0845e850a7b986e00c80af2

Comment by Peter Jones [ 03/Mar/18 ]

Landed for 2.11

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