dm log writes: fix max length used for kstrndup
authorMa Shimiao <mashimiao.fnst@cn.fujitsu.com>
Tue, 12 Dec 2017 09:39:10 +0000 (17:39 +0800)
committerMike Snitzer <snitzer@redhat.com>
Wed, 17 Jan 2018 14:16:16 +0000 (09:16 -0500)
commit4b259fc4a8a12dcd0ffd670877a7a1ca2ab0f3e3
tree948cf6d3629f6ce40f142532faaca9121c2d65f3
parentd5ffebdd797a7c1c89576267640f671db2a668fc
dm log writes: fix max length used for kstrndup

If source string is longer than max, kstrndup will allocate max+1
space.  So make sure the result will not exceed max.

Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-log-writes.c