VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Eric Sandeen <sandeen@redhat.com> 2012-08-18 22:29:40 -0400 committer: Theodore Ts'o <tytso@mit.edu> 2012-08-18 22:29:40 -0400 commit: eeecef0af5ea4efd763c9554cf2bd80fc4a0efd3 parent: caecd0af8fe0635e8e6900399b951433af35bf52
Commit Summary:
jbd2: don't write superblock when if its empty
Diffstat:
1 file changed, 5 insertions, 0 deletions
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index bd23f2ebaa67..0f16edd51f67 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -1354,6 +1354,11 @@ static void jbd2_mark_journal_empty(journal_t *journal)
 
 	BUG_ON(!mutex_is_locked(&journal->j_checkpoint_mutex));
 	read_lock(&journal->j_state_lock);
+	/* Is it already empty? */
+	if (sb->s_start == 0) {
+		read_unlock(&journal->j_state_lock);
+		return;
+	}
 	jbd_debug(1, "JBD2: Marking journal as empty (seq %d)\n",
 		  journal->j_tail_sequence);