From e70a208249503ae237b035bfc6e9116c2c6fa762 Mon Sep 17 00:00:00 2001 From: ngkaho1234 Date: Sat, 28 Nov 2015 20:38:33 +0000 Subject: [PATCH] ext4_journal: simple handling on superblock. --- lwext4/ext4_journal.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lwext4/ext4_journal.c b/lwext4/ext4_journal.c index 2f0a095..88e9f61 100644 --- a/lwext4/ext4_journal.c +++ b/lwext4/ext4_journal.c @@ -374,9 +374,14 @@ static void jbd_replay_block_tags(struct jbd_fs *jbd_fs, uint16_t mount_count, state; mount_count = ext4_get16(&fs->sb, mount_count); state = ext4_get16(&fs->sb, state); - memcpy(&fs->sb, - journal_block.data, - EXT4_SUPERBLOCK_SIZE); + r = ext4_blocks_set_direct(fs->bdev, journal_block.data, + 0, 1); + if (r != EOK) + return; + + r = ext4_sb_read(fs->bdev, &fs->sb); + if (r != EOK) + return; /* Mark system as mounted */ ext4_set16(&fs->sb, state, state);