In the main loop of fsrallfs, we exit when we've hit the timeout but
we increment fs before we get there. If we're operating on the last
file system in the array, we'll hit an uninitialized fsdesc and
crash in fsrall_cleanup.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
[sandeen: change Jeff's for(; loop]
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
/* reorg for 'howlong' -- checked in 'fsrfs' */
while (endtime > time(0)) {
pid_t pid;
- if (fs == fsend)
- fs = fsbase;
- if (fs->npass == npasses) {
- fsrprintf(_("Completed all %d passes\n"), npasses);
- break;
- }
+
if (npasses > 1 && !fs->npass)
Mflag = 1;
else
startino = 0; /* reset after the first time through */
fs->npass++;
fs++;
+ if (fs == fsend)
+ fs = fsbase;
+ if (fs->npass == npasses) {
+ fsrprintf(_("Completed all %d passes\n"), npasses);
+ break;
+ }
}
fsrall_cleanup(endtime <= time(0));
}