diff --git a/lib/blobfs/blobfs.c b/lib/blobfs/blobfs.c index 2aa9d45a3..666cfa969 100644 --- a/lib/blobfs/blobfs.c +++ b/lib/blobfs/blobfs.c @@ -2539,6 +2539,8 @@ spdk_file_read(struct spdk_file *file, struct spdk_fs_thread_ctx *ctx, if (length > (final_offset - offset)) { length = final_offset - offset; } + + sub_reads++; rc = __file_read(file, payload, offset, length, channel); if (rc == 0) { final_length += length; @@ -2547,7 +2549,6 @@ spdk_file_read(struct spdk_file *file, struct spdk_fs_thread_ctx *ctx, } payload += length; offset += length; - sub_reads++; } pthread_spin_unlock(&file->lock); while (sub_reads-- > 0) {