diff --git a/fs/ext4/super.c b/fs/ext4/super.c index ed6c1e7bc65384214845b85661149250243218ec..15bc072dd011de40ab2b217933450fda9fc5887b 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3091,8 +3091,15 @@ static void ext4_orphan_cleanup(struct super_block *sb, inode_lock(inode); truncate_inode_pages(inode->i_mapping, inode->i_size); ret = ext4_truncate(inode); - if (ret) + if (ret) { + /* + * We need to clean up the in-core orphan list + * manually if ext4_truncate() failed to get a + * transaction handle. + */ + ext4_orphan_del(NULL, inode); ext4_std_error(inode->i_sb, ret); + } inode_unlock(inode); nr_truncates++; } else {