Skip to content

Conversation

@SuhoSon
Copy link

@SuhoSon SuhoSon commented Jun 23, 2025

Description

When Protection Information (PI) is enabled on NVMe devices, the file size was incorrectly calculated using data->lba_size instead of data->lba_ext. This caused FIO to access only a portion of the device(e.g. 4096/(4096+64)=98.46%), leading to incomplete I/O coverage during tests.

This patch updates the real_file_size calculation logic to conditionally use data->lba_ext when available, and fall back to data->lba_size otherwise. This ensures that FIO correctly calculates the full storage capacity and accesses the entire device area when PI is enabled.

Fixes

  • Incomplete device access in FIO when PI is enabled
  • Incorrect real_file_size assignment due to using lba_size instead of lba_ext

… with PI enabled

Fix real_file_size calculation when PI is enabled

When PI is enabled, the extended LBA (lba_ext) should be used to calculate
real_file_size instead of lba_size. This ensures FIO can access the entire
device area correctly.

Signed-off by: Suho Son <[email protected]>
@axboe axboe merged commit 7060d7b into axboe:master Jun 23, 2025
14 of 17 checks passed
@SuhoSon SuhoSon deleted the fix_real_file_size_when_pi_is_enabled branch June 24, 2025 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants