]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
btrfs: include root in error message when unlinking inode
authorFilipe Manana <fdmanana@suse.com>
Thu, 22 May 2025 15:10:00 +0000 (16:10 +0100)
committerDavid Sterba <dsterba@suse.com>
Thu, 19 Jun 2025 13:18:30 +0000 (15:18 +0200)
To help debugging include the root number in the error message, and since
this is a critical error that implies a metadata inconsistency and results
in a transaction abort change the log message level from "info" to
"critical", which is a much better fit.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c

index c0c778243bf124cc49714534e6d29aca8782ed63..a62f92ab5977bc4173ba3978fecb96654434b0e3 100644 (file)
@@ -4250,9 +4250,9 @@ static int __btrfs_unlink_inode(struct btrfs_trans_handle *trans,
 
        ret = btrfs_del_inode_ref(trans, root, name, ino, dir_ino, &index);
        if (ret) {
-               btrfs_info(fs_info,
-                       "failed to delete reference to %.*s, inode %llu parent %llu",
-                       name->len, name->name, ino, dir_ino);
+               btrfs_crit(fs_info,
+          "failed to delete reference to %.*s, root %llu inode %llu parent %llu",
+                          name->len, name->name, btrfs_root_id(root), ino, dir_ino);
                btrfs_abort_transaction(trans, ret);
                goto err;
        }