Patch "btrfs: improve error message after failure to add delayed dir index item" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    btrfs: improve error message after failure to add delayed dir index item

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     btrfs-improve-error-message-after-failure-to-add-del.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 42774ceb524b47d7ec2e1f47d71f00678184b884
Author: Filipe Manana <fdmanana@xxxxxxxx>
Date:   Mon Aug 28 09:06:42 2023 +0100

    btrfs: improve error message after failure to add delayed dir index item
    
    [ Upstream commit 91bfe3104b8db0310f76f2dcb6aacef24c889366 ]
    
    If we fail to add a delayed dir index item because there's already another
    item with the same index number, we print an error message (and then BUG).
    However that message isn't very helpful to debug anything because we don't
    know what's the index number and what are the values of index counters in
    the inode and its delayed inode (index_cnt fields of struct btrfs_inode
    and struct btrfs_delayed_node).
    
    So update the error message to include the index number and counters.
    
    We actually had a recent case where this issue was hit by a syzbot report
    (see the link below).
    
    Link: https://lore.kernel.org/linux-btrfs/00000000000036e1290603e097e0@xxxxxxxxxx/
    Reviewed-by: Qu Wenruo <wqu@xxxxxxxx>
    Signed-off-by: Filipe Manana <fdmanana@xxxxxxxx>
    Reviewed-by: David Sterba <dsterba@xxxxxxxx>
    Signed-off-by: David Sterba <dsterba@xxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c
index e6872d65c0e25..fd951aeaeac5a 100644
--- a/fs/btrfs/delayed-inode.c
+++ b/fs/btrfs/delayed-inode.c
@@ -1401,9 +1401,10 @@ int btrfs_insert_delayed_dir_index(struct btrfs_trans_handle *trans,
 	ret = __btrfs_add_delayed_insertion_item(delayed_node, delayed_item);
 	if (unlikely(ret)) {
 		btrfs_err(trans->fs_info,
-			  "err add delayed dir index item(name: %.*s) into the insertion tree of the delayed node(root id: %llu, inode id: %llu, errno: %d)",
-			  name_len, name, delayed_node->root->root_key.objectid,
-			  delayed_node->inode_id, ret);
+"error adding delayed dir index item, name: %.*s, index: %llu, root: %llu, dir: %llu, dir->index_cnt: %llu, delayed_node->index_cnt: %llu, error: %d",
+			  name_len, name, index, btrfs_root_id(delayed_node->root),
+			  delayed_node->inode_id, dir->index_cnt,
+			  delayed_node->index_cnt, ret);
 		BUG();
 	}
 	mutex_unlock(&delayed_node->mutex);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux