@@ -109,13 +109,6 @@ _("Must be root to run scrub."));
return false;
}
- ctx->nr_io_threads = nproc;
- if (verbose) {
- fprintf(stdout, _("%s: using %d threads to scrub.\n"),
- ctx->mntpoint, scrub_nproc(ctx));
- fflush(stdout);
- }
-
if (!platform_test_xfs_fd(ctx->mnt_fd)) {
str_info(ctx, ctx->mntpoint,
_("Does not appear to be an XFS filesystem!"));
@@ -193,6 +186,13 @@ _("Unable to find realtime device path."));
return false;
}
+ ctx->nr_io_threads = disk_heads(ctx->datadev);
+ if (verbose) {
+ fprintf(stdout, _("%s: using %d threads to scrub.\n"),
+ ctx->mntpoint, scrub_nproc(ctx));
+ fflush(stdout);
+ }
+
if (ctx->fsinfo.fs_log) {
ctx->logdev = disk_open(ctx->fsinfo.fs_log);
if (error) {