Fixed uninitialized io_blocksize in random pass

This commit is contained in:
Fabian Druschke
2025-11-28 21:38:53 +01:00
parent 259ee26273
commit b79530c292

View File

@@ -393,6 +393,9 @@ int nwipe_random_pass( NWIPE_METHOD_SIGNATURE )
syncRate = 0;
}
/* Select effective I/O block size (e.g. 4 MiB, never smaller than st_blksize). */
io_blocksize = nwipe_effective_io_blocksize( c );
/* Compute the per-write sync rate based on io_blocksize and old semantics. */
syncRate = nwipe_compute_sync_rate_for_device( c, io_blocksize );
@@ -411,9 +414,6 @@ int nwipe_random_pass( NWIPE_METHOD_SIGNATURE )
return -1;
}
/* Select effective I/O block size (e.g. 4 MiB, never smaller than st_blksize). */
io_blocksize = nwipe_effective_io_blocksize( c );
/*
* Allocate a generic 16 MiB buffer (by default) that is used as the
* scratch area for random data. We will only fill and write "blocksize"