projects
/
lwext4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
03375d2
)
ext4_journal: do simple verification on jbd superblock.
author
ngkaho1234
<ngkaho1234@gmail.com>
Tue, 1 Dec 2015 16:31:24 +0000
(16:31 +0000)
committer
ngkaho1234
<ngkaho1234@gmail.com>
Tue, 1 Dec 2015 16:31:24 +0000
(16:31 +0000)
lwext4/ext4_journal.c
patch
|
blob
|
history
diff --git
a/lwext4/ext4_journal.c
b/lwext4/ext4_journal.c
index e798590cb6a0e938775d9d96efb692ab3832f4e2..83647b782eb5bc508209c41975ab049b8cd6d8a2 100644
(file)
--- a/
lwext4/ext4_journal.c
+++ b/
lwext4/ext4_journal.c
@@
-150,6
+150,12
@@
int jbd_get_fs(struct ext4_fs *fs,
if (rc != EOK) {
memset(jbd_fs, 0, sizeof(struct jbd_fs));
ext4_fs_put_inode_ref(&jbd_fs->inode_ref);
+ return rc;
+ }
+ if (!jbd_verify_sb(&jbd_fs->sb)) {
+ memset(jbd_fs, 0, sizeof(struct jbd_fs));
+ ext4_fs_put_inode_ref(&jbd_fs->inode_ref);
+ rc = EIO;
}
return rc;