]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
Btrfs: fix printing of non NULL terminated string
authorFilipe David Borba Manana <fdmanana@gmail.com>
Tue, 20 Aug 2013 16:51:48 +0000 (17:51 +0100)
committerChris Mason <chris.mason@fusionio.com>
Sun, 1 Sep 2013 12:16:20 +0000 (08:16 -0400)
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>
fs/btrfs/delayed-inode.c

index 33dd4a5349fb5fdb369aec3e230da0d259799422..cbd9523ad09cae0ffff1688371b370a756aef2f5 100644 (file)
@@ -1471,10 +1471,10 @@ int btrfs_insert_delayed_dir_index(struct btrfs_trans_handle *trans,
        mutex_lock(&delayed_node->mutex);
        ret = __btrfs_add_delayed_insertion_item(delayed_node, delayed_item);
        if (unlikely(ret)) {
-               printk(KERN_ERR "err add delayed dir index item(name: %s) into "
-                               "the insertion tree of the delayed node"
+               printk(KERN_ERR "err add delayed dir index item(name: %.*s) "
+                               "into the insertion tree of the delayed node"
                                "(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);
                BUG();
        }