]> git.ipfire.org Git - thirdparty/mdadm.git/commit - super-intel.c
imsm: write bad block log on metadata sync
authorTomasz Majchrzak <tomasz.majchrzak@intel.com>
Tue, 29 Nov 2016 13:02:28 +0000 (14:02 +0100)
committerJes Sorensen <Jes.Sorensen@redhat.com>
Fri, 2 Dec 2016 16:02:11 +0000 (11:02 -0500)
commitbbab0940fa7584f0d33afd759343730ccb77d6ab
tree0d682eb4e705cfac81ceea20bf5d12afd84c5448
parent8d67477fd13086471fe08826f3f6333819cc8a71
imsm: write bad block log on metadata sync

Pre-allocate memory for largest possible bad block section when monitor
is being opened to avoid a need for memory allocation on metadata sync.

If memory for a structure has been allocated in mpb buffer but it hasn't
been used yet, it will be taken by next buffer grow, leading to
insufficient memory on metadata flush. Start tracking such memory and
take it into calculation when growing a buffer. Also assert has been
added to debug mode to warn when more metadata has been written than
memory allocated.

Signed-off-by: Tomasz Majchrzak <tomasz.majchrzak@intel.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
super-intel.c