linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/3] No more seq_file pre-allocation
@ 2015-06-01 21:32 Yann Droneaud
  2015-06-01 21:32 ` [PATCH v1 1/3] fs: use seq_open_private() for proc_mounts Yann Droneaud
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yann Droneaud @ 2015-06-01 21:32 UTC (permalink / raw)
  To: Al Viro, Andrew Morton; +Cc: linux-fsdevel, linux-kernel, Yann Droneaud

Hi,

Please find a revised patchset to remove support for
passing pre-allocated struct seq_file to seq_open().

Such feature is undocumented and prone to error.

In particular, if seq_release() is used in release
handler, it will kfree() a pointer which was not
allocated by seq_open().

So, please find a patchset that drop the support for
pre-allocated struct seq_file: it's only of use in
proc_namespace.c and can be easily replaced by using
seq_open_private()/seq_release_private().

Additionally, it documents the use of file->private_data
to hold pointer to struct seq_file by seq_open().

Changes from v0 [0]:
- convert kmalloc() + memset() to kzalloc()
- revised a bit commit messages

[0] [PATCH 0/3] seq_file allocation in seq_open()

http://lkml.kernel.org/r/cover.1430777196.git.ydroneaud@opteya.com
http://lkml.kernel.org/g/cover.1430777196.git.ydroneaud@opteya.com

Yann Droneaud (3):
  fs: use seq_open_private() for proc_mounts
  fs: allocate structure unconditionally in seq_open()
  fs: documents seq_open()'s usage of file->private_data

 fs/mount.h          |  3 ---
 fs/namespace.c      |  6 +++---
 fs/proc_namespace.c | 34 ++++++++++++++++------------------
 fs/seq_file.c       | 19 +++++++++++--------
 4 files changed, 30 insertions(+), 32 deletions(-)

-- 
2.4.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-06-01 21:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-01 21:32 [PATCH v1 0/3] No more seq_file pre-allocation Yann Droneaud
2015-06-01 21:32 ` [PATCH v1 1/3] fs: use seq_open_private() for proc_mounts Yann Droneaud
2015-06-01 21:32 ` [PATCH v1 2/3] fs: allocate structure unconditionally in seq_open() Yann Droneaud
2015-06-01 21:32 ` [PATCH v1 3/3] fs: documents seq_open()'s usage of file->private_data Yann Droneaud

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).