ref: d44c244db5af1ce24454d651d00565bf09a99020
parent: 13025de0e6e1dd697a468a8b94842c73e2343bb3
author: ngkaho1234 <[email protected]>
date: Fri Dec 18 05:23:59 EST 2015
ext4_journal: clear end_write and end_write_arg fields when appropriate.
--- a/lwext4/ext4_journal.c
+++ b/lwext4/ext4_journal.c
@@ -1359,7 +1359,7 @@
/**@brief Update the start block of the journal when
* all the contents in a transaction reach the disk.*/
static void jbd_trans_end_write(struct ext4_bcache *bc __unused,
- struct ext4_buf *buf __unused,
+ struct ext4_buf *buf,
int res,
void *arg)
{
@@ -1369,6 +1369,10 @@
trans == TAILQ_FIRST(&journal->cp_queue);
if (res != EOK)
trans->error = res;
+
+ /* Clear the end_write and end_write_arg fields. */
+ buf->end_write = NULL;
+ buf->end_write_arg = NULL;
trans->written_cnt++;
if (trans->written_cnt == trans->data_cnt) {