shithub: lwext4

Download patch

ref: dd9afaebb842141fa01d09a7296e91be5915cd26
parent: 5b99cfc34279cd95c82510c4404b6625170dbdfb
author: Sigrid Solveig Haflínudóttir <[email protected]>
date: Mon Mar 1 12:49:47 EST 2021

ext4 journal: data is not *always* set despite success, add an assert to spot this specific issue

--- a/src/ext4_bcache.c
+++ b/src/ext4_bcache.c
@@ -235,9 +235,11 @@
 		      bool *is_new)
 {
 	/* Try to search the buffer with exaxt LBA. */
+
 	struct ext4_buf *buf = ext4_bcache_find_get(bc, b, b->lb_id);
 	if (buf) {
 		*is_new = false;
+		fprint(2, "buf %p data %p: %p\n", buf, buf->data, b->data);
 		return EOK;
 	}
 
--- a/src/ext4_journal.c
+++ b/src/ext4_journal.c
@@ -1336,6 +1336,7 @@
 						&jbd_block,
 						jbd_buf->jbd_lba);
 			ext4_assert(r == EOK);
+			ext4_assert(jbd_block.data != NULL);
 			memcpy(tmp_data, jbd_block.data,
 					journal->block_size);
 			ext4_block_set(fs->bdev, &jbd_block);