ubifs: Add printf debugging to see where we have the error in mounting
This commit is contained in:
parent
6d8f8e005e
commit
85323309ed
|
@ -586,18 +586,22 @@ static int mount_ubifs(struct ubifs_info *c)
|
||||||
long long x;
|
long long x;
|
||||||
size_t sz;
|
size_t sz;
|
||||||
|
|
||||||
|
printf("%d: Init Constants\n", __LINE__);
|
||||||
err = init_constants_early(c);
|
err = init_constants_early(c);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
|
printf("%d: Debugging init\n", __LINE__);
|
||||||
err = ubifs_debugging_init(c);
|
err = ubifs_debugging_init(c);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
|
printf("%d: Check volume\n", __LINE__);
|
||||||
err = check_volume_empty(c);
|
err = check_volume_empty(c);
|
||||||
if (err)
|
if (err)
|
||||||
goto out_free;
|
goto out_free;
|
||||||
|
|
||||||
|
printf("%d: Empty?\n", __LINE__);
|
||||||
if (c->empty && (mounted_read_only || c->ro_media)) {
|
if (c->empty && (mounted_read_only || c->ro_media)) {
|
||||||
/*
|
/*
|
||||||
* This UBI volume is empty, and read-only, or the file system
|
* This UBI volume is empty, and read-only, or the file system
|
||||||
|
@ -609,6 +613,7 @@ static int mount_ubifs(struct ubifs_info *c)
|
||||||
goto out_free;
|
goto out_free;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printf("%d: Empty?\n", __LINE__);
|
||||||
if (c->ro_media && !mounted_read_only) {
|
if (c->ro_media && !mounted_read_only) {
|
||||||
ubifs_err("cannot mount read-write - read-only media");
|
ubifs_err("cannot mount read-write - read-only media");
|
||||||
err = -EROFS;
|
err = -EROFS;
|
||||||
|
@ -621,10 +626,12 @@ static int mount_ubifs(struct ubifs_info *c)
|
||||||
* never exceed 64.
|
* never exceed 64.
|
||||||
*/
|
*/
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
|
printf("%d: Alloc?\n", __LINE__);
|
||||||
c->bottom_up_buf = kmalloc(BOTTOM_UP_HEIGHT * sizeof(int), GFP_KERNEL);
|
c->bottom_up_buf = kmalloc(BOTTOM_UP_HEIGHT * sizeof(int), GFP_KERNEL);
|
||||||
if (!c->bottom_up_buf)
|
if (!c->bottom_up_buf)
|
||||||
goto out_free;
|
goto out_free;
|
||||||
|
|
||||||
|
printf("%d: Alloc?\n", __LINE__);
|
||||||
c->sbuf = vmalloc(c->leb_size);
|
c->sbuf = vmalloc(c->leb_size);
|
||||||
if (!c->sbuf)
|
if (!c->sbuf)
|
||||||
goto out_free;
|
goto out_free;
|
||||||
|
@ -635,6 +642,7 @@ static int mount_ubifs(struct ubifs_info *c)
|
||||||
*/
|
*/
|
||||||
c->always_chk_crc = 1;
|
c->always_chk_crc = 1;
|
||||||
|
|
||||||
|
printf("%d: Read SB?\n", __LINE__);
|
||||||
err = ubifs_read_superblock(c);
|
err = ubifs_read_superblock(c);
|
||||||
if (err)
|
if (err)
|
||||||
goto out_free;
|
goto out_free;
|
||||||
|
@ -643,18 +651,22 @@ static int mount_ubifs(struct ubifs_info *c)
|
||||||
* Make sure the compressor which is set as default in the superblock
|
* Make sure the compressor which is set as default in the superblock
|
||||||
* or overridden by mount options is actually compiled in.
|
* or overridden by mount options is actually compiled in.
|
||||||
*/
|
*/
|
||||||
|
printf("%d: Compr?\n", __LINE__);
|
||||||
if (!ubifs_compr_present(c->default_compr)) {
|
if (!ubifs_compr_present(c->default_compr)) {
|
||||||
ubifs_err("'compressor \"%s\" is not compiled in",
|
ubifs_err("'compressor \"%s\" is not compiled in",
|
||||||
ubifs_compr_name(c->default_compr));
|
ubifs_compr_name(c->default_compr));
|
||||||
goto out_free;
|
goto out_free;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printf("%d: init?\n", __LINE__);
|
||||||
dbg_failure_mode_registration(c);
|
dbg_failure_mode_registration(c);
|
||||||
|
|
||||||
|
printf("%d: init?\n", __LINE__);
|
||||||
err = init_constants_sb(c);
|
err = init_constants_sb(c);
|
||||||
if (err)
|
if (err)
|
||||||
goto out_free;
|
goto out_free;
|
||||||
|
|
||||||
|
printf("%d: alloc?\n", __LINE__);
|
||||||
sz = ALIGN(c->max_idx_node_sz, c->min_io_size);
|
sz = ALIGN(c->max_idx_node_sz, c->min_io_size);
|
||||||
sz = ALIGN(sz + c->max_idx_node_sz, c->min_io_size);
|
sz = ALIGN(sz + c->max_idx_node_sz, c->min_io_size);
|
||||||
c->cbuf = kmalloc(sz, GFP_NOFS);
|
c->cbuf = kmalloc(sz, GFP_NOFS);
|
||||||
|
@ -663,12 +675,15 @@ static int mount_ubifs(struct ubifs_info *c)
|
||||||
goto out_free;
|
goto out_free;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printf("%d: read master?\n", __LINE__);
|
||||||
sprintf(c->bgt_name, BGT_NAME_PATTERN, c->vi.ubi_num, c->vi.vol_id);
|
sprintf(c->bgt_name, BGT_NAME_PATTERN, c->vi.ubi_num, c->vi.vol_id);
|
||||||
|
|
||||||
err = ubifs_read_master(c);
|
err = ubifs_read_master(c);
|
||||||
if (err)
|
if (err)
|
||||||
goto out_master;
|
goto out_master;
|
||||||
|
|
||||||
|
printf("%d: read master?\n", __LINE__);
|
||||||
|
sprintf(c->bgt_name, BGT_NAME_PATTERN, c->vi.ubi_num, c->vi.vol_id);
|
||||||
init_constants_master(c);
|
init_constants_master(c);
|
||||||
|
|
||||||
if ((c->mst_node->flags & cpu_to_le32(UBIFS_MST_DIRTY)) != 0) {
|
if ((c->mst_node->flags & cpu_to_le32(UBIFS_MST_DIRTY)) != 0) {
|
||||||
|
@ -676,22 +691,28 @@ static int mount_ubifs(struct ubifs_info *c)
|
||||||
c->need_recovery = 1;
|
c->need_recovery = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printf("%d: lpt?\n", __LINE__);
|
||||||
|
sprintf(c->bgt_name, BGT_NAME_PATTERN, c->vi.ubi_num, c->vi.vol_id);
|
||||||
err = ubifs_lpt_init(c, 1, !mounted_read_only);
|
err = ubifs_lpt_init(c, 1, !mounted_read_only);
|
||||||
if (err)
|
if (err)
|
||||||
goto out_lpt;
|
goto out_lpt;
|
||||||
|
|
||||||
|
printf("%d: idx?\n", __LINE__);
|
||||||
err = dbg_check_idx_size(c, c->old_idx_sz);
|
err = dbg_check_idx_size(c, c->old_idx_sz);
|
||||||
if (err)
|
if (err)
|
||||||
goto out_lpt;
|
goto out_lpt;
|
||||||
|
|
||||||
|
printf("%d: journal?\n", __LINE__);
|
||||||
err = ubifs_replay_journal(c);
|
err = ubifs_replay_journal(c);
|
||||||
if (err)
|
if (err)
|
||||||
goto out_journal;
|
goto out_journal;
|
||||||
|
|
||||||
|
printf("%d: orphans?\n", __LINE__);
|
||||||
err = ubifs_mount_orphans(c, c->need_recovery, mounted_read_only);
|
err = ubifs_mount_orphans(c, c->need_recovery, mounted_read_only);
|
||||||
if (err)
|
if (err)
|
||||||
goto out_orphans;
|
goto out_orphans;
|
||||||
|
|
||||||
|
printf("%d: recovery %d?\n", __LINE__, c->need_recovery);
|
||||||
if (c->need_recovery) {
|
if (c->need_recovery) {
|
||||||
err = ubifs_recover_size(c);
|
err = ubifs_recover_size(c);
|
||||||
if (err)
|
if (err)
|
||||||
|
@ -702,6 +723,7 @@ static int mount_ubifs(struct ubifs_info *c)
|
||||||
list_add_tail(&c->infos_list, &ubifs_infos);
|
list_add_tail(&c->infos_list, &ubifs_infos);
|
||||||
spin_unlock(&ubifs_infos_lock);
|
spin_unlock(&ubifs_infos_lock);
|
||||||
|
|
||||||
|
printf("%d: recovery %d?\n", __LINE__, c->need_recovery);
|
||||||
if (c->need_recovery) {
|
if (c->need_recovery) {
|
||||||
if (mounted_read_only)
|
if (mounted_read_only)
|
||||||
ubifs_msg("recovery deferred");
|
ubifs_msg("recovery deferred");
|
||||||
|
@ -711,6 +733,7 @@ static int mount_ubifs(struct ubifs_info *c)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printf("%d: check\n", __LINE__);
|
||||||
err = dbg_check_filesystem(c);
|
err = dbg_check_filesystem(c);
|
||||||
if (err)
|
if (err)
|
||||||
goto out_infos;
|
goto out_infos;
|
||||||
|
@ -812,6 +835,7 @@ out_free:
|
||||||
vfree(c->sbuf);
|
vfree(c->sbuf);
|
||||||
kfree(c->bottom_up_buf);
|
kfree(c->bottom_up_buf);
|
||||||
ubifs_debugging_exit(c);
|
ubifs_debugging_exit(c);
|
||||||
|
printf("SOME ERROR\n");
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue