Skip to content

Commit

Permalink
fix(middlewared/disk): only run savecore in unused partitions
Browse files Browse the repository at this point in the history
Ticket:	#27516
  • Loading branch information
william-gr committed Feb 8, 2018
1 parent e0bacdc commit 4a80398
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/middlewared/middlewared/plugins/disk.py
Expand Up @@ -633,9 +633,11 @@ async def swaps_configure(self):
for p in g.providers:
# if swap partition
if p.config['rawtype'] == '516e7cb5-6ecf-11d6-8ff8-00022d09712b':
# Try to save a core dump from that
await run('savecore', '-z', '-m', '5', '/data/crash/', f'/dev/{p.name}', check=False)
if p.name not in used_partitions:
# Try to save a core dump from that.
# Only try savecore if the partition is not already in use
# to avoid errors in the console (#27516)
await run('savecore', '-z', '-m', '5', '/data/crash/', f'/dev/{p.name}', check=False)
swap_partitions_by_size[p.mediasize].append(p.name)

dumpdev = False
Expand Down

0 comments on commit 4a80398

Please sign in to comment.