From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f67.google.com ([209.85.221.67]:45350 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2436758AbeKWARx (ORCPT ); Thu, 22 Nov 2018 19:17:53 -0500 Date: Thu, 22 Nov 2018 16:38:26 +0300 From: Alexey Dobriyan To: Yafang Shao Cc: Andrew Morton , viro@zeniv.linux.org.uk, Kees Cook , LKML , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH] procfs: fix the output format in /proc/PID/wchan Message-ID: <20181122133826.GA14139@avx2> References: <1542626272-29129-1-git-send-email-laoar.shao@gmail.com> <20181121192844.1cd1c2fa4801a324d059176c@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Nov 22, 2018 at 09:29:52PM +0800, Yafang Shao wrote: > On Thu, Nov 22, 2018 at 7:40 PM Alexey Dobriyan wrote: > > > > On Wed, Nov 21, 2018 at 07:28:44PM -0800, Andrew Morton wrote: > > > On Mon, 19 Nov 2018 19:17:52 +0800 Yafang Shao wrote: > > > > > > > Just add the missing newline. > > > > > > > > ... > > > > > > > > --- a/fs/proc/base.c > > > > +++ b/fs/proc/base.c > > > > @@ -370,11 +370,12 @@ static int proc_pid_wchan(struct seq_file *m, struct pid_namespace *ns, > > > > wchan = get_wchan(task); > > > > if (wchan && !lookup_symbol_name(wchan, symname)) { > > > > seq_puts(m, symname); > > > > + seq_putc(m, '\n'); > > > > return 0; > > > > } > > > > > > > > print0: > > > > - seq_putc(m, '0'); > > > > + seq_puts(m, "0\n"); > > > > return 0; > > > > } > > > > #endif /* CONFIG_KALLSYMS */ > > > > > > What is presently wrong with the wchan output? The changelog > > > should explain such things, please. > > > > It is just newline to make "cat /proc/*/wchan" output look cool. > > But newline can break something. > > Could you pls. show some examples for what the newline may break ? char buf[16]; rv = read(fd, buf, sizeof(buf)); assert(rv == 1);