Commit bdab49d7 authored by Filipe David Borba Manana's avatar Filipe David Borba Manana Committed by Chris Mason

Btrfs: fix printing of non NULL terminated string

The name buffer is not terminated by a '\0' character,
therefore it needs to be printed with %.*s and use the
length of the buffer.
Signed-off-by: default avatarFilipe David Borba Manana <fdmanana@gmail.com>
Signed-off-by: default avatarJosef Bacik <jbacik@fusionio.com>
Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
parent 8d78eb16
...@@ -1471,10 +1471,10 @@ int btrfs_insert_delayed_dir_index(struct btrfs_trans_handle *trans, ...@@ -1471,10 +1471,10 @@ int btrfs_insert_delayed_dir_index(struct btrfs_trans_handle *trans,
mutex_lock(&delayed_node->mutex); mutex_lock(&delayed_node->mutex);
ret = __btrfs_add_delayed_insertion_item(delayed_node, delayed_item); ret = __btrfs_add_delayed_insertion_item(delayed_node, delayed_item);
if (unlikely(ret)) { if (unlikely(ret)) {
printk(KERN_ERR "err add delayed dir index item(name: %s) into " printk(KERN_ERR "err add delayed dir index item(name: %.*s) "
"the insertion tree of the delayed node" "into the insertion tree of the delayed node"
"(root id: %llu, inode id: %llu, errno: %d)\n", "(root id: %llu, inode id: %llu, errno: %d)\n",
name, delayed_node->root->objectid, name_len, name, delayed_node->root->objectid,
delayed_node->inode_id, ret); delayed_node->inode_id, ret);
BUG(); BUG();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment