+ fs-documents-seq_opens-usage-of-file-private_data.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: fs: document seq_open()'s usage of file->private_data
has been added to the -mm tree.  Its filename is
     fs-documents-seq_opens-usage-of-file-private_data.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/fs-documents-seq_opens-usage-of-file-private_data.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/fs-documents-seq_opens-usage-of-file-private_data.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Yann Droneaud <ydroneaud@xxxxxxxxxx>
Subject: fs: document seq_open()'s usage of file->private_data

seq_open() stores its struct seq_file in file->private_data, thus it must
not be modified by user of seq_file.

Link: http://lkml.kernel.org/r/cover.1433193673.git.ydroneaud@xxxxxxxxxx
Signed-off-by: Yann Droneaud <ydroneaud@xxxxxxxxxx>
Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 fs/seq_file.c |    2 ++
 1 file changed, 2 insertions(+)

diff -puN fs/seq_file.c~fs-documents-seq_opens-usage-of-file-private_data fs/seq_file.c
--- a/fs/seq_file.c~fs-documents-seq_opens-usage-of-file-private_data
+++ a/fs/seq_file.c
@@ -48,6 +48,8 @@ static void *seq_buf_alloc(unsigned long
  *	ERR_PTR(error).  In the end of sequence they return %NULL. ->show()
  *	returns 0 in case of success and negative number in case of error.
  *	Returning SEQ_SKIP means "discard this element and move on".
+ *	Note: seq_open() will allocate a struct seq_file and store its
+ *	pointer in @file->private_data. This pointer should not be modified.
  */
 int seq_open(struct file *file, const struct seq_operations *op)
 {
_

Patches currently in -mm which might be from ydroneaud@xxxxxxxxxx are

fs-use-seq_open_private-for-proc_mounts.patch
fs-allocate-structure-unconditionally-in-seq_open.patch
fs-documents-seq_opens-usage-of-file-private_data.patch
linux-next.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux