Commit 78ba12ec authored by Wang Shilong's avatar Wang Shilong Committed by Tomasz Zawadzki
Browse files

module/blobfs: fix segmentation fault when fuse mount fail



if mountpoint doesn't exist, fuse mount will fail and @bfuse
will be null, blobfs_fuse_stop() try to access it without
check which cause segmentation finally.

Patch also improve test messages output to include
terminator properly.

Signed-off-by: default avatarWang Shilong <wangshilong1991@gmail.com>
Change-Id: Idba23e3922778f1985d1f4841a1701cdc272ef17
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3863


Community-CI: Mellanox Build Bot
Reviewed-by: default avatarXiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 09d6e90a
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -353,6 +353,8 @@ err:
void
blobfs_fuse_stop(struct spdk_blobfs_fuse *bfuse)
{
	if (bfuse) {
		fuse_session_exit(fuse_get_session(bfuse->fuse_handle));
		pthread_kill(bfuse->fuse_tid, SIGINT);
	}
}
+2 −2
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ static void
fuse_run_cb(void *cb_arg, int fserrno)
{
	if (fserrno) {
		printf("Failed to mount filesystem on bdev %s to path %s: %s",
		printf("Failed to mount filesystem on bdev %s to path %s: %s\n",
		       g_bdev_name, g_mountpoint, spdk_strerror(fserrno));

		spdk_app_stop(0);
@@ -69,7 +69,7 @@ fuse_run_cb(void *cb_arg, int fserrno)
static void
spdk_fuse_run(void *arg1)
{
	printf("Mounting filesystem on bdev %s to path %s...",
	printf("Mounting filesystem on bdev %s to path %s...\n",
	       g_bdev_name, g_mountpoint);
	fflush(stdout);