ref: ad9c06e29a2dcdde75d401553879beced580ad94
parent: 1ff612f04d8ea35ad6f9a3feeacd60d93d14c1ad
author: ngkaho1234 <[email protected]>
date: Sun Dec 20 00:49:53 EST 2015
ext4_journal: clear end_write and end_write_arg if buffer is not dirty.
--- a/lwext4/ext4_journal.c
+++ b/lwext4/ext4_journal.c
@@ -1121,6 +1121,8 @@
LIST_FOREACH_SAFE(jbd_buf, &trans->buf_list, buf_node,
tmp) {
if (abort) {
+ jbd_buf->block.buf->end_write = NULL;
+ jbd_buf->block.buf->end_write_arg = NULL;
ext4_bcache_clear_dirty(jbd_buf->block.buf);
ext4_block_set(fs->bdev, &jbd_buf->block);
}
@@ -1190,6 +1192,8 @@
BC_DIRTY)) {
/* The buffer has not been modified, just release
* that jbd_buf. */
+ jbd_buf->block.buf->end_write = NULL;
+ jbd_buf->block.buf->end_write_arg = NULL;
ext4_block_set(fs->bdev, &jbd_buf->block);
LIST_REMOVE(jbd_buf, buf_node);
free(jbd_buf);