Skip to content

Commit 561c67d

Browse files
Alexander Aringteigland
authored andcommitted
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 <[email protected]> Signed-off-by: David Teigland <[email protected]>
1 parent c4f4e13 commit 561c67d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

fs/dlm/dir.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,8 @@ void dlm_copy_master_names(struct dlm_ls *ls, char *inbuf, int inlen,
245245
if (inlen > 1) {
246246
r = find_rsb_root(ls, inbuf, inlen);
247247
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);
251250
goto out;
252251
}
253252
list = r->res_root_list.next;

0 commit comments

Comments
 (0)