Re: BUG in Reiserfs Journal Thread

2004-09-15 Thread Vijayan Prabhakaran
I'm using reiserfs 3.6 with the data journaling patch from
ftp://ftp.suse.com/pub/people/mason/patches/data-logging/2.4.25/.


On Wed, 15 Sep 2004 16:07:16 -0400, Chris Mason <[EMAIL PROTECTED]> wrote:
> On Wed, 2004-09-15 at 16:02, Vijayan Prabhakaran wrote:
> > Dear Chris Mason,
> >
> > I found a bug in Reiserfs journal thread. This bug is in function
> > reiserfs_journal_commit_thread().
> 
> Hi,
> 
> Which version of the code are you reading?
> 
> -chris
> 
>


Re: BUG in Reiserfs Journal Thread

2004-09-15 Thread Chris Mason
On Wed, 2004-09-15 at 16:02, Vijayan Prabhakaran wrote:
> Dear Chris Mason,
> 
> I found a bug in Reiserfs journal thread. This bug is in function
> reiserfs_journal_commit_thread().

Hi,

Which version of the code are you reading?

-chris




BUG in Reiserfs Journal Thread

2004-09-15 Thread Vijayan Prabhakaran
Dear Chris Mason,

I found a bug in Reiserfs journal thread. This bug is in function
reiserfs_journal_commit_thread().

I'm trying to measure the impact of journal thread on data flushes. I
changed the commit interval from the default of 5 seconds (this value
is hard coded in the function) to other different values. I found that
irrespective of changing the journal thread's timer value, the dirty
data was not getting flushed after the time out at the commit thread.

The reason for this is due to a bug in the code. The code looks like

while(1) {

  /*blah blah blah*/

  if (CURRENT_TIME - last_run > 5) {
reiserfs_flush_old_commits(s);
  }

  /*blah blah blah*/

  interruptible_sleep_on_timeout(&reiserfs_commit_thread_wait, 5 * HZ) ;

  /*thread wakes up*/
}

If you see the code, the thread sleeps for 5 seconds. But after waking
up, it again checks the condition:

if (CURRENT_TIME - last_run > 5) {
   reiserfs_flush_old_commits(s);
}

Actually, the condition should be ">=" instead of ">". Since the
thread wakes up immediately after the timer expires, the condition
will never satisfy if it is ">".

Chris, can you please verify this and add the fix ?

I appreciate your help.

Vijayan