diff --git a/lib/blobfs/blobfs.c b/lib/blobfs/blobfs.c index ecf165bb6..be646dae2 100644 --- a/lib/blobfs/blobfs.c +++ b/lib/blobfs/blobfs.c @@ -2456,6 +2456,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; @@ -2464,7 +2466,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) {