Revision ad576e63e0c8b274a8558b8e05a6d0526e804dc0 authored by Nick Piggin on 05 May 2005, 23:15:46 UTC, committed by Linus Torvalds on 05 May 2005, 23:36:40 UTC
When running fsstress -v -d $DIR/tmp -n 1000 -p 1000 -l 2 on an ext2 filesystem with 1024 byte block size, on SMP i386 with 4096 byte page size over loopback to an image file on a tmpfs filesystem, I would very quickly hit BUG_ON(!buffer_async_write(bh)); in fs/buffer.c:end_buffer_async_write It seems that more than one request would be submitted for a given bh at a time. What would happen is the following: 2 threads doing __mpage_writepages on the same page. Thread 1 - lock the page first, and enter __block_write_full_page. Thread 1 - (eg.) mark_buffer_async_write on the first 2 buffers. Thread 1 - set page writeback, unlock page. Thread 2 - lock page, wait on page writeback Thread 1 - submit_bh on the first 2 buffers. => both requests complete, none of the page buffers are async_write, end_page_writeback is called. Thread 2 - wakes up. enters __block_write_full_page. Thread 2 - mark_buffer_async_write on (eg.) the last buffer Thread 1 - finds the last buffer has async_write set, submit_bh on that. Thread 2 - submit_bh on the last buffer. => oops. So change __block_write_full_page to explicitly keep track of the last bh we need to issue, so we don't touch anything after issuing the last request. Signed-off-by: Nick Piggin <nickpiggin@yahoo.com.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent f3ddbdc
File | Mode | Size |
---|---|---|
irq | ||
power | ||
Makefile | -rw-r--r-- | 2.1 KB |
acct.c | -rw-r--r-- | 14.4 KB |
audit.c | -rw-r--r-- | 23.2 KB |
auditsc.c | -rw-r--r-- | 28.6 KB |
capability.c | -rw-r--r-- | 5.8 KB |
compat.c | -rw-r--r-- | 21.4 KB |
configs.c | -rw-r--r-- | 3.3 KB |
cpu.c | -rw-r--r-- | 4.2 KB |
cpuset.c | -rw-r--r-- | 39.5 KB |
dma.c | -rw-r--r-- | 3.5 KB |
exec_domain.c | -rw-r--r-- | 4.3 KB |
exit.c | -rw-r--r-- | 38.5 KB |
extable.c | -rw-r--r-- | 2.0 KB |
fork.c | -rw-r--r-- | 31.3 KB |
futex.c | -rw-r--r-- | 19.3 KB |
intermodule.c | -rw-r--r-- | 5.1 KB |
itimer.c | -rw-r--r-- | 6.5 KB |
kallsyms.c | -rw-r--r-- | 10.4 KB |
kfifo.c | -rw-r--r-- | 4.7 KB |
kmod.c | -rw-r--r-- | 7.2 KB |
kprobes.c | -rw-r--r-- | 7.1 KB |
ksysfs.c | -rw-r--r-- | 1.3 KB |
kthread.c | -rw-r--r-- | 4.7 KB |
module.c | -rw-r--r-- | 52.8 KB |
panic.c | -rw-r--r-- | 3.4 KB |
params.c | -rw-r--r-- | 16.8 KB |
pid.c | -rw-r--r-- | 7.5 KB |
posix-cpu-timers.c | -rw-r--r-- | 40.8 KB |
posix-timers.c | -rw-r--r-- | 44.9 KB |
printk.c | -rw-r--r-- | 25.2 KB |
profile.c | -rw-r--r-- | 14.7 KB |
ptrace.c | -rw-r--r-- | 8.8 KB |
rcupdate.c | -rw-r--r-- | 14.0 KB |
resource.c | -rw-r--r-- | 11.6 KB |
sched.c | -rw-r--r-- | 124.4 KB |
seccomp.c | -rw-r--r-- | 1.1 KB |
signal.c | -rw-r--r-- | 68.9 KB |
softirq.c | -rw-r--r-- | 11.1 KB |
spinlock.c | -rw-r--r-- | 7.6 KB |
stop_machine.c | -rw-r--r-- | 4.8 KB |
sys.c | -rw-r--r-- | 39.9 KB |
sys_ni.c | -rw-r--r-- | 2.3 KB |
sysctl.c | -rw-r--r-- | 54.3 KB |
time.c | -rw-r--r-- | 15.6 KB |
timer.c | -rw-r--r-- | 41.8 KB |
uid16.c | -rw-r--r-- | 4.2 KB |
user.c | -rw-r--r-- | 4.3 KB |
wait.c | -rw-r--r-- | 7.1 KB |
workqueue.c | -rw-r--r-- | 13.5 KB |
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...