From patchwork Mon Jun 1 21:32:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yann Droneaud X-Patchwork-Id: 6524761 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5D779C0433 for ; Mon, 1 Jun 2015 21:32:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 938B62045E for ; Mon, 1 Jun 2015 21:32:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8FB6420495 for ; Mon, 1 Jun 2015 21:32:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754113AbbFAVct (ORCPT ); Mon, 1 Jun 2015 17:32:49 -0400 Received: from smtp4-g21.free.fr ([212.27.42.4]:23866 "EHLO smtp4-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754071AbbFAVcj (ORCPT ); Mon, 1 Jun 2015 17:32:39 -0400 Received: from localhost.localdomain (unknown [IPv6:2a01:e35:2e9f:6ac0:684c:e451:65d7:ebf6]) by smtp4-g21.free.fr (Postfix) with ESMTPS id 889CB4C808C; Mon, 1 Jun 2015 23:28:34 +0200 (CEST) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.15.1/8.14.8) with ESMTP id t51LWXvv032335; Mon, 1 Jun 2015 23:32:33 +0200 Received: (from ydroneaud@localhost) by localhost.localdomain (8.15.1/8.15.1/Submit) id t51LWWOg032334; Mon, 1 Jun 2015 23:32:32 +0200 From: Yann Droneaud To: Al Viro , Andrew Morton Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Yann Droneaud Subject: [PATCH v1 3/3] fs: documents seq_open()'s usage of file->private_data Date: Mon, 1 Jun 2015 23:32:15 +0200 Message-Id: <4840cc5370d9b4e4cc9344da47ed3e1fb67e9a0a.1433193673.git.ydroneaud@opteya.com> X-Mailer: git-send-email 2.4.2 In-Reply-To: References: In-Reply-To: References: Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP seq_open() store 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@opteya.com Signed-off-by: Yann Droneaud --- fs/seq_file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/seq_file.c b/fs/seq_file.c index a909f12dad4d..e48ef5682bfa 100644 --- a/fs/seq_file.c +++ b/fs/seq_file.c @@ -48,6 +48,8 @@ static void *seq_buf_alloc(unsigned long size) * 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) {