blobfs: return the correct file length.
If the file have cache data and not flushed, the file length will be not correct. Change-Id: Idde23e158c1d010e67579b5d6a8d87d3cfbfed2d Signed-off-by: Cunyin Chang <cunyin.chang@intel.com> Reviewed-on: https://review.gerrithub.io/393784 Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
parent
cacfeef389
commit
0e48ef40df
@ -789,7 +789,7 @@ spdk_fs_file_stat_async(struct spdk_filesystem *fs, const char *name,
|
||||
f = fs_find_file(fs, name);
|
||||
if (f != NULL) {
|
||||
stat.blobid = f->blobid;
|
||||
stat.size = f->length;
|
||||
stat.size = f->append_pos >= f->length ? f->append_pos : f->length;
|
||||
cb_fn(cb_arg, &stat, 0);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user