From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steven Whitehouse Subject: Re: [PATCH] seq_file: Allow private data to be supplied on seq_open Date: Thu, 07 Aug 2014 14:32:15 +0100 Message-ID: <53E37FDF.50102@redhat.com> References: <1406655593-12626-1-git-send-email-rob.jones@codethink.co.uk> <20140806160259.GR18016@ZenIV.linux.org.uk> <53E254F1.30605@codethink.co.uk> <87sil9sa50.fsf@x220.int.ebiederm.org> <53E37810.1050109@codethink.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Al Viro , linux-fsdevel@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel@lists.codethink.co.uk, ian.molton@codethink.co.uk To: Rob Jones , "Eric W. Biederman" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:47295 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757417AbaHGNc0 (ORCPT ); Thu, 7 Aug 2014 09:32:26 -0400 In-Reply-To: <53E37810.1050109@codethink.co.uk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hi, On 07/08/14 13:58, Rob Jones wrote: [snip] > > On a related subject, Having looked at a few uses of seq_file, I must > say that some users seem to make assumptions about the internal > workings of the module. Dangerous behaviour as only some behaviours are > documented. > > e.g. The behaviour that "struct seq_file" pointer is stored in > file->private_data is documented and can therefore be relied upon but > the fact that the output buffer and its size are only defined at the > first output (and can therefore be pre-defined and pre-allocated by > user code) is not documented and could therefore change without warning. > > This second behaviour is assumed in, for example, module fs/gfs2/glock.c > which could, therefore, stop working properly without warning if the > internal behaviour was changed. > While it is undocumented, it is I understand, how this feature was intended to be used, so I think that it is safe to do this in the GFS2 case. Here is a ref to the thread which explains how it landed up like that: https://www.redhat.com/archives/cluster-devel/2012-June/msg00000.html Steve.