[dm-devel] ext4_writepages: jbd2_start: 5120 pages, ino 11; err -5

Theodore Ts'o tytso at mit.edu
Tue May 31 15:39:15 UTC 2022


Hmmm..... I think this patch should fix your issues.

If the journal has been aborted (which happens as part of the
shutdown, we will never write out the commit block --- so it should be
fine to skip the writeback of any dirty inodes in data=ordered mode.

BTW, if you know that the file system is going to get nuked in this
way all the time, so you never care about file system after it is shut
down, you could mount the file system with the mount option
data=writeback.

       	      	      	    		- Ted


diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 8ff4c6545a49..2e18211121f6 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -542,7 +542,10 @@ static int ext4_journalled_submit_inode_data_buffers(struct jbd2_inode *jinode)
 static int ext4_journal_submit_inode_data_buffers(struct jbd2_inode *jinode)
 {
 	int ret;
+	journal_t *journal = EXT4_SB(jinode->i_vfs_inode->i_sb)->s_journal;
 
+	if (!journal || is_journal_aborted(journal))
+		return 0;
 	if (ext4_should_journal_data(jinode->i_vfs_inode))
 		ret = ext4_journalled_submit_inode_data_buffers(jinode);
 	else
@@ -554,7 +557,10 @@ static int ext4_journal_submit_inode_data_buffers(struct jbd2_inode *jinode)
 static int ext4_journal_finish_inode_data_buffers(struct jbd2_inode *jinode)
 {
 	int ret = 0;
+	journal_t *journal = EXT4_SB(jinode->i_vfs_inode->i_sb)->s_journal;
 
+	if (!journal || is_journal_aborted(journal))
+		return 0;
 	if (!ext4_should_journal_data(jinode->i_vfs_inode))
 		ret = jbd2_journal_finish_inode_data_buffers(jinode);



More information about the dm-devel mailing list