Skip to contentSkip to conversation

ext4: Fix reference counting on buffer head.

PATCH New Aneesh Kumar K.V 1 participant 2 messages Feb 4, 2008 Journalling layer for block devices (JBD2)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ext4: Fix reference counting on buffer head.

With journal checksum patch we added asyn commit of journal commit headers. During the conversion we missed to take a reference on buffer head. Before the change sync_dirty_buffer did the get_bh(). The associative put_bh is done by journal_wait_on_commit_record()

---
 fs/jbd2/commit.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/jbd2/commit.c +1 -1
index da8d0eb..2b88ab0 100644
@@ -136,7 +136,7 @@ static int journal_submit_commit_record(journal_t *journal,
 
 	JBUFFER_TRACE(descriptor, "submit commit block");
 	lock_buffer(bh);
-
+	get_bh(bh);
 	set_buffer_dirty(bh);
 	set_buffer_uptodate(bh);
 	bh->b_end_io = journal_end_buffer_io_sync;
Signature · 1 line
1.5.4.rc3.24.gb53139-dirty
#1 lore raw

PATCH 1/1 ext4: Use the right macro for testing the incompat feature.

Incompat feature need to be checked using JBD2_HAS_INCOMPAT_FEATURE

---
 fs/jbd2/commit.c   |    2 +-
 fs/jbd2/recovery.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
fs/jbd2/commit.c +1 -1
index 2b88ab0..9cd9288 100644
@@ -142,7 +142,7 @@ static int journal_submit_commit_record(journal_t *journal,
 	bh->b_end_io = journal_end_buffer_io_sync;
 
 	if (journal->j_flags & JBD2_BARRIER &&
-		!JBD2_HAS_COMPAT_FEATURE(journal,
+		!JBD2_HAS_INCOMPAT_FEATURE(journal,
 					 JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT)) {
 		set_buffer_ordered(bh);
 		barrier_done = 1;
fs/jbd2/recovery.c +1 -1
index 9216806..f8ec777 100644
@@ -641,7 +641,7 @@ static int do_one_pass(journal_t *journal,
 				if (chksum_err) {
 					info->end_transaction = next_commit_ID;
 
-					if (!JBD2_HAS_COMPAT_FEATURE(journal,
+					if (!JBD2_HAS_INCOMPAT_FEATURE(journal,
 					   JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT)){
 						printk(KERN_ERR
 						       "JBD: Transaction %u "
Signature · 1 line
1.5.4.rc3.24.gb53139-dirty