From: Christoph Hellwig <hch@lst.de>
To: Chunyu Hu <chuhu@redhat.com>
Cc: viro@zeniv.linux.org.uk, hch@lst.de,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] proc: add proc_seq_release
Date: Mon, 11 Jun 2018 08:23:54 +0200 [thread overview]
Message-ID: <20180611062354.GA32641@lst.de> (raw)
In-Reply-To: <1528573884-9133-1-git-send-email-chuhu@redhat.com>
On Sun, Jun 10, 2018 at 03:51:24AM +0800, Chunyu Hu wrote:
> kmemleak reported some memory leak on reading proc files. After adding
> some debug lines, find that proc_seq_fops is using seq_release as
> release handler, which won't handle the free of 'private' field of
> seq_file, while in fact the open handler proc_seq_open could create
> the private data with __seq_open_private when state_size is greater
> than zero. So after reading files created with proc_create_seq_private,
> such as /proc/timer_list and /proc/vmallocinfo, the private mem of a
> seq_file is not freed. Fix it by adding the paired proc_seq_release
> as the default release handler of proc_seq_ops instead of seq_release.
Indeed, thanks for the patch.
Reviewed-by: Christoph Hellwig <hch@lst.de>
next prev parent reply other threads:[~2018-06-11 6:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-09 19:51 [PATCH] proc: add proc_seq_release Chunyu Hu
2018-06-11 6:23 ` Christoph Hellwig [this message]
2018-06-26 12:20 ` Chunyu Hu
2018-06-27 7:09 ` Christoph Hellwig
2018-06-28 0:43 ` Al Viro
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=20180611062354.GA32641@lst.de \
--to=hch@lst.de \
--cc=chuhu@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.