remarkable-linux/include
Frederic Weisbecker 08f14fc896 kill-the-bkl/reiserfs: move the concurrent tree accesses checks per superblock
When do_balance() balances the tree, a trick is performed to
provide the ability for other tree writers/readers to check whether
do_balance() is executing concurrently (requires CONFIG_REISERFS_CHECK).

This is done to protect concurrent accesses to the tree. The trick
is the following:

When do_balance is called, a unique global variable called cur_tb
takes a pointer to the current tree to be rebalanced.
Once do_balance finishes its work, cur_tb takes the NULL value.

Then, concurrent tree readers/writers just have to check the value
of cur_tb to ensure do_balance isn't executing concurrently.
If it is, then it proves that schedule() occured on do_balance(),
which then relaxed the bkl that protected the tree.

Now that the bkl has be turned into a mutex, this check is still
fine even though do_balance() becomes preemptible: the write lock
will not be automatically released on schedule(), so the tree is
still protected.

But this is only fine if we have a single reiserfs mountpoint.
Indeed, because the bkl is a global lock, it didn't allowed
concurrent executions between a tree reader/writer in a mount point
and a do_balance() on another tree from another mountpoint.

So assuming all these readers/writers weren't supposed to be
reentrant, the current check now sometimes detect false positives with
the current per-superblock mutex which allows this reentrancy.

This patch keeps the concurrent tree accesses check but moves it
per superblock, so that only trees from a same mount point are
checked to be not accessed concurrently.

[ Impact: fix spurious panic while running several reiserfs mount-points ]

Cc: Jeff Mahoney <jeffm@suse.com>
Cc: Chris Mason <chris.mason@oracle.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
2009-09-14 07:18:25 +02:00
..
acpi ACPI processor: force throttling state when BIOS returns incorrect value 2009-08-26 20:06:53 -07:00
asm-generic mm: Pass virtual address to [__]p{te,ud,md}_free_tlb() 2009-07-27 12:10:38 -07:00
crypto crypto: skcipher - Fix skcipher_dequeue_givcrypt NULL test 2009-08-29 20:44:04 +10:00
drm drm/radeon: add GET_PARAM/INFO support for Z pipes 2009-08-21 19:10:30 +10:00
keys
linux kill-the-bkl/reiserfs: move the concurrent tree accesses checks per superblock 2009-09-14 07:18:25 +02:00
math-emu
media V4L/DVB (12283): gspca - sn9c20x: New subdriver for sn9c201 and sn9c202 bridges. 2009-07-24 14:03:30 -03:00
mtd
net pkt_sched: Revert tasklet_hrtimer changes. 2009-09-01 17:59:25 -07:00
pcmcia
rdma
rxrpc
scsi
sound
trace perf_counter: Zero dead bytes from ftrace raw samples size alignment 2009-08-10 16:51:19 +02:00
video
xen
Kbuild