Skip to content

Commit bdab49d

Browse files
fdmananaChris Mason
authored andcommitted
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: Filipe David Borba Manana <fdmanana@gmail.com> Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
1 parent 8d78eb1 commit bdab49d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎fs/btrfs/delayed-inode.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,10 +1471,10 @@ int btrfs_insert_delayed_dir_index(struct btrfs_trans_handle *trans,
14711471
mutex_lock(&delayed_node->mutex);
14721472
ret = __btrfs_add_delayed_insertion_item(delayed_node, delayed_item);
14731473
if (unlikely(ret)) {
1474-
printk(KERN_ERR "err add delayed dir index item(name: %s) into "
1475-
"the insertion tree of the delayed node"
1474+
printk(KERN_ERR "err add delayed dir index item(name: %.*s) "
1475+
"into the insertion tree of the delayed node"
14761476
"(root id: %llu, inode id: %llu, errno: %d)\n",
1477-
name, delayed_node->root->objectid,
1477+
name_len, name, delayed_node->root->objectid,
14781478
delayed_node->inode_id, ret);
14791479
BUG();
14801480
}

0 commit comments

Comments
 (0)