Commit 50ffc3b64aa3c8113f0a9fc31ea96e596d60054a

Authored by Lan Yixun (dlan)
Committed by Tom Rini
1 parent 8b415f703f

fs/ext4: fix log2blksz un-initialized error, by cacaulating its value from blksz

The problem here is that uboot can't mount ext4 filesystem with
commit "50ce4c07df1" applied. We use hard-coded "SECTOR_SIZE"(512)
before this commit, now we introduce (block_dev_desc_t *)->log2blksz
to replace this macro. And after we calling do_ls()->fs_set_blk_dev(),
the variable log2blksz is not initialized, which it's not correct.

And this patch try to solve the problem by caculating the value of
log2blksz from variable blksz.

Showing 1 changed file with 4 additions and 0 deletions Side-by-side Diff

... ... @@ -548,6 +548,8 @@
548 548 goto cleanup;
549 549 }
550 550  
  551 + (*dev_desc)->log2blksz = LOG2((*dev_desc)->blksz);
  552 +
551 553 info->start = 0;
552 554 info->size = (*dev_desc)->lba;
553 555 info->blksz = (*dev_desc)->blksz;
... ... @@ -630,6 +632,8 @@
630 632 ret = -1;
631 633 goto cleanup;
632 634 }
  635 +
  636 + (*dev_desc)->log2blksz = LOG2((*dev_desc)->blksz);
633 637  
634 638 ret = part;
635 639 goto cleanup;