Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fs: dlm: drop rxbuf manipulation in dlm_copy_master_names

This patch removes the manipulation of the receive buffer in case of an
error and be sure the buffer is null terminated before an error
messagea is printed out. Instead of manipulate the receive buffer we
tell inside the format string the maximum length the string buffer is
being read.

Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>

authored by

Alexander Aring and committed by
David Teigland
561c67d8 c4f4e135

+2 -3
+2 -3
fs/dlm/dir.c
··· 245 245 if (inlen > 1) { 246 246 r = find_rsb_root(ls, inbuf, inlen); 247 247 if (!r) { 248 - inbuf[inlen - 1] = '\0'; 249 - log_error(ls, "copy_master_names from %d start %d %s", 250 - nodeid, inlen, inbuf); 248 + log_error(ls, "copy_master_names from %d start %d %.*s", 249 + nodeid, inlen, inlen, inbuf); 251 250 goto out; 252 251 } 253 252 list = r->res_root_list.next;