Commit 13a58c41 authored by Ziye Yang's avatar Ziye Yang Committed by Jim Harris
Browse files

blobfs: fix the length value of file.



In function spdk_fs_file_stat_async, the
stat.size = f->append_pos >= f->length ? f->append_pos : f->length;

but in spdk_file_get_length, we return f->length.

So generally, it should all use the same method to return the file
length, and this patch will fix this issue.

Change-Id: Idb9aa9e737711fcd48ac0075c7f7ffed825fe3b0
Signed-off-by: default avatarZiye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/c/439627


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 55ce66a0
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1451,9 +1451,13 @@ spdk_file_get_name(struct spdk_file *file)
uint64_t
spdk_file_get_length(struct spdk_file *file)
{
	uint64_t length;

	assert(file != NULL);
	SPDK_DEBUGLOG(SPDK_LOG_BLOBFS, "file=%s length=0x%jx\n", file->name, file->length);
	return file->length;

	length = file->append_pos >= file->length ? file->append_pos : file->length;
	SPDK_DEBUGLOG(SPDK_LOG_BLOBFS, "file=%s length=0x%jx\n", file->name, length);
	return length;
}

static void