All of lore.kernel.org
 help / color / mirror / Atom feed
* Another bug in commiting old transactions
@ 2004-09-15 21:34 Vijayan Prabhakaran
  0 siblings, 0 replies; only message in thread
From: Vijayan Prabhakaran @ 2004-09-15 21:34 UTC (permalink / raw)
  To: mason, reiserfs-list; +Cc: vijayan

Hi,

This is in continuation to my previous mail on bug in
reiserfs_journal_commit_thread().

Previous bug:
---------------
There is an "if" condition in reiserfs_journal_commit_thread():

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

that must be changed to

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

New bug:
----------
Even after changing the above "if" condition to use ">=" instead of
">", dirty old data were not being flushed by the file system. The
reason for this in reiserfs_flush_old_commits() function.

There is a safety check in reiserfs_flush_old_commits(). It looks like:

/* safety check so we don't flush while we are replaying the log during
 * mount
 */
if (list_empty(&SB_JOURNAL(p_s_sb)->j_journal_list)) {
  return 0  ;
}

This condition was added so that the reiserfs doesn't flush dirty data
while replaying during mount.

But the first transaction after the mount does NOT get flushed to the
disk because of this condition. The first transaction gets added to
the j_journal_list only in function do_journal_end(). So, until that
point the j_journal_list remains empty.

Fix:
----
Actually, we don't need this condition at all.
reiserfs_flush_old_commits() function will be called only ONLY by the
reiserfs_journal_commit_thread. And this thread is created only after
the replay is over (in journal_init() function). So, I thought even
removing this condition would not affect the system in any way.

Chris: Any comments on this fix ? If you think it is ok, can you
please add this also to your patch ?

I appreciate your help.

Vijayan

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-09-15 21:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-15 21:34 Another bug in commiting old transactions Vijayan Prabhakaran

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.