OSDN Git Service

staging: lustre: llite: initialize xattr->xe_namelen
authorJames Simmons <jsimmons@infradead.org>
Mon, 16 Apr 2018 04:14:50 +0000 (00:14 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Apr 2018 12:57:40 +0000 (14:57 +0200)
commit15f7330be7c0416ea5400dcd286730481c20a84f
tree7fa7ec63995e68435a87c7515205369ad01c40b8
parentba833f145745c5ca4d1d45b1de2541fe34b8f100
staging: lustre: llite: initialize xattr->xe_namelen

When the allocation of xattr->xe_name was moved to kstrdup()
setting xattr->xe_namelen was dropped. This field is used
in several parts of the xattr cache code so it broke xattr
handling. Initialize xattr->xe_namelen when allocating
xattr->xe_name succeeds. Also change the debugging statement
to really report the xattr name instead of its length which
wasn't event being set.

Fixes: b3dd8957c23a ("staging: lustre: lustre: llite: Use kstrdup"
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/llite/xattr_cache.c