This could cause certain mke2fs feature combinations to result in the
initial blocks of the inode table getting wiped out when the journal
is created.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/* OK, do the write loop */
j=0;
while (j < num) {
- if (blk % STRIDE_LENGTH)
+ if (blk % STRIDE_LENGTH) {
count = STRIDE_LENGTH - (blk % STRIDE_LENGTH);
- else {
+ if (count > (num - j))
+ count = num - j;
+ } else {
count = num - j;
if (count > STRIDE_LENGTH)
count = STRIDE_LENGTH;