blobcli: use spdk_thread_send_msg when dumping blob
For thin provisioned blobs, an IO read to an unallocated cluster completes inline, meaning that if the read completion function issues another read, we can quickly blow the stack. So use spdk_thread_send_msg() to issue the next read operation. Fixes #2405. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: I10a40b83bfc25fa6bbd8bc93b6fea36ac8ee83c6 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11784 Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Dong Yi <dongx.yi@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
parent
c32476bb36
commit
f45c98dd29
@ -578,6 +578,8 @@ set_xattr_cb(void *cb_arg, struct spdk_blob *blob, int bserrno)
|
||||
spdk_blob_sync_md(cli_context->blob, sync_cb, cli_context);
|
||||
}
|
||||
|
||||
static void __read_dump_cb(void *arg1);
|
||||
|
||||
/*
|
||||
* Callback function for reading a blob for dumping to a file.
|
||||
*/
|
||||
@ -603,6 +605,19 @@ read_dump_cb(void *arg1, int bserrno)
|
||||
return;
|
||||
}
|
||||
|
||||
/* This completion may have occurred in the context of a read to
|
||||
* an unallocated cluster. So we can't issue the next read here, or
|
||||
* we risk overflowing the stack. So use spdk_thread_send_msg() to
|
||||
* make sure we unwind before doing the next read.
|
||||
*/
|
||||
spdk_thread_send_msg(spdk_get_thread(), __read_dump_cb, cli_context);
|
||||
}
|
||||
|
||||
static void
|
||||
__read_dump_cb(void *arg1)
|
||||
{
|
||||
struct cli_context_t *cli_context = arg1;
|
||||
|
||||
printf(".");
|
||||
if (++cli_context->io_unit_count < cli_context->blob_io_units) {
|
||||
/* perform another read */
|
||||
|
Loading…
Reference in New Issue
Block a user