coredump:need close block device when finish coredump

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
anjiahao 2024-06-27 18:10:30 +08:00 committed by Xiang Xiao
parent 2414fc91ff
commit d347da10ca
1 changed files with 9 additions and 0 deletions

View File

@ -730,6 +730,15 @@ static void coredump_dump_blkdev(pid_t pid)
return;
}
/* Close block device directly, make sure all data write to block device */
ret = g_blockstream.inode->u.i_bops->close(g_blockstream.inode);
if (ret < 0)
{
_alert("Coredump information close fail\n");
return;
}
_alert("Finish coredump, write %d bytes to %s\n",
info->size, CONFIG_BOARD_COREDUMP_BLKDEV_PATH);
}