From b9552111fc66ec2ebfccbd99a924f5f7ec2d7612 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Wed, 28 Sep 2022 13:41:36 +0200 Subject: [PATCH] ext4: Suppress sporadic error messages Supress the sporadic "ext4_writepages: jbd2_start: XXX pages, ino YYY; err -5" warnings we sometimes get when mxqd tries to unmount the temporary job filesystems using - fcntl EXT4_IOC_SHUTDOWN with EXT4_GOING_FLAGS_NOLOGFLUSH - dmestup reload $dmname --table "0 $sectors zero" - dmsetup resume $dmname --noflush - umount $mountpoint - dmsetup remove --deferred $dmname - rmdir $mountpoint --- fs/ext4/inode.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 98f381f6fc180..d380cdf924532 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -2797,9 +2797,10 @@ static int ext4_writepages(struct address_space *mapping, EXT4_HT_WRITE_PAGE, needed_blocks, rsv_blocks); if (IS_ERR(handle)) { ret = PTR_ERR(handle); - ext4_msg(inode->i_sb, KERN_CRIT, "%s: jbd2_start: " - "%ld pages, ino %lu; err %d", __func__, - wbc->nr_to_write, inode->i_ino, ret); + if (!unlikely(ext4_forced_shutdown(EXT4_SB(inode->i_sb)))) + ext4_msg(inode->i_sb, KERN_CRIT, "%s: jbd2_start: " + "%ld pages, ino %lu; err %d", __func__, + wbc->nr_to_write, inode->i_ino, ret); /* Release allocated io_end */ ext4_put_io_end(mpd.io_submit.io_end); mpd.io_submit.io_end = NULL;