From: Jerome Marchand <jmarchan@redhat.com>
To: Pavel Emelyanov <xemul@parallels.com>
Cc: Matthew Wilcox <matthew@wil.cx>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] procfs: fix numbering in /proc/locks
Date: Wed, 29 Sep 2010 14:00:19 +0200 [thread overview]
Message-ID: <4CA32A53.6000007@redhat.com> (raw)
In-Reply-To: <4CA32982.1090809@parallels.com>
On 09/29/2010 01:56 PM, Pavel Emelyanov wrote:
> On 09/29/2010 03:52 PM, Jerome Marchand wrote:
>> On 09/29/2010 01:43 PM, Pavel Emelyanov wrote:
>>>> Good point. My implementation is definitely wrong. But I'm afraid that
>>>> moving the increment in locks_next() won't help either. It will fail when
>>>> a program do something more than just read the file sequentially (use
>>>> of lseek() for instance). We need a better way to keep track of the
>>>> current position in the list.
>>>
>>> The seq files core implementation knows about the lseek and
>>> calls the seq_ops callbacks properly.
>>>
>>
>> Yes, but if read a few lines and then lseek() back. I'm afraid it will call
>> a few more locks_next() function and thus increase the counter again.
>
> No. If you lseek back it calls the locks_start which should reset the
> counter, and then will call locks_next.
>
> Can you try out my proposal and check whether it really works as expected?
>
OK. I didn't understand you meant to keep the reset in locks_start(). I'll
try that.
Jerome
prev parent reply other threads:[~2010-09-29 12:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-27 15:13 [PATCH] procfs: fix numbering in /proc/locks Jerome Marchand
2010-09-27 15:24 ` Pavel Emelyanov
2010-09-29 11:42 ` Jerome Marchand
2010-09-29 11:43 ` Pavel Emelyanov
2010-09-29 11:52 ` Jerome Marchand
2010-09-29 11:56 ` Pavel Emelyanov
2010-09-29 12:00 ` Jerome Marchand [this message]
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=4CA32A53.6000007@redhat.com \
--to=jmarchan@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew@wil.cx \
--cc=xemul@parallels.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox