linux/fs/jbd2
Josef Bacik 9fc7c63a1d jbd2: fix the way the b_modified flag is cleared
Currently at the start of a journal commit we loop through all of the buffers
on the committing transaction and clear the b_modified flag (the flag that is
set when a transaction modifies the buffer) under the j_list_lock.

The problem is that everywhere else this flag is modified only under the jbd2
lock buffer flag, so it will race with a running transaction who could
potentially set it, and have it unset by the committing transaction.

This is also a big waste, you can have several thousands of buffers that you
are clearing the modified flag on when you may not need to.  This patch
removes this code and instead clears the b_modified flag upon entering
do_get_write_access/journal_get_create_access, so if that transaction does
indeed use the buffer then it will be accounted for properly, and if it does
not then we know we didn't use it.

That will be important for the next patch in this series.  Tested thoroughly
by myself using postmark/iozone/bonnie++.

Cc: <linux-ext4@vger.kernel.org>
Cc: Jan Kara <jack@ucw.cz>
Signed-off-by: Josef Bacik <jbacik@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-17 10:38:59 -04:00
..
checkpoint.c spinlock: lockbreak cleanup 2008-01-30 13:31:20 +01:00
commit.c jbd2: fix the way the b_modified flag is cleared 2008-04-17 10:38:59 -04:00
journal.c jbd2: use non-racy method for proc entries creation 2008-04-29 08:06:20 -07:00
Makefile [PATCH] jbd2: rename jbd2 symbols to avoid duplication of jbd symbols 2006-10-11 11:14:15 -07:00
recovery.c jbd2: correctly unescape journal data blocks 2008-03-19 18:53:36 -07:00
revoke.c jbd/jbd2 NULL noise 2008-03-30 14:18:41 -07:00
transaction.c jbd2: fix the way the b_modified flag is cleared 2008-04-17 10:38:59 -04:00