linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: Yafang Shao <laoar.shao@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	viro@zeniv.linux.org.uk, Kees Cook <keescook@chromium.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] procfs: fix the output format in /proc/PID/wchan
Date: Thu, 22 Nov 2018 16:38:26 +0300	[thread overview]
Message-ID: <20181122133826.GA14139@avx2> (raw)
In-Reply-To: <CALOAHbBaR2GB1Xtzzi9bNprfCWSP_PV5FCfAG_xK=jqg8uuong@mail.gmail.com>

On Thu, Nov 22, 2018 at 09:29:52PM +0800, Yafang Shao wrote:
> On Thu, Nov 22, 2018 at 7:40 PM Alexey Dobriyan <adobriyan@gmail.com> 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 <laoar.shao@gmail.com> 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);

  reply	other threads:[~2018-11-23  0:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-19 11:17 [PATCH] procfs: fix the output format in /proc/PID/wchan Yafang Shao
2018-11-22  3:28 ` Andrew Morton
2018-11-22 11:40   ` Alexey Dobriyan
2018-11-22 13:29     ` Yafang Shao
2018-11-22 13:38       ` Alexey Dobriyan [this message]
2018-11-23  9:57         ` Yafang Shao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181122133826.GA14139@avx2 \
    --to=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=keescook@chromium.org \
    --cc=laoar.shao@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).