linux-IllusionX/fs
Jan Kara 4407c2b6b2 [PATCH] Fix race in do_get_write_access()
attached patch should fix the following race:
     Proc 1                               Proc 2

     __flush_batch()
       ll_rw_block()
                                        do_get_write_access()
					   lock_buffer
                                             jh is only waiting for checkpoint
					     -> b_transaction == NULL ->
					     do nothing
                                           unlock_buffer
    test_set_buffer_locked()
    test_clear_buffer_dirty()
                                           __journal_file_buffer()
                                        change the data
    submit_bh()

and we have sent wrong data to disk...  We now clean the dirty buffer flag
under buffer lock in all cases and hence we know that whenever a buffer is
starting to be journaled we either finish the pending write-out before
attaching a buffer to a transaction or we won't write the buffer until the
transaction is going to be committed.

The test in jbd_unexpected_dirty_buffer() is redundant - remove it.
Furthermore we have to clear the buffer dirty bit under the buffer lock to
prevent races with buffer write-out (and hence prevent returning a buffer with
IO happening).

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-09-07 16:57:57 -07:00
..
adfs
affs
afs
autofs
autofs4
befs
bfs
cifs [PATCH] fs: convert kcalloc to kzalloc 2005-09-07 16:57:46 -07:00
coda
cramfs [PATCH] fix cramfs making duplicate entries in inode cache 2005-09-07 16:57:33 -07:00
debugfs
devfs
devpts
efs
exportfs
ext2
ext3
fat
freevxfs [PATCH] fs: convert kcalloc to kzalloc 2005-09-07 16:57:46 -07:00
hfs [PATCH] hfs: NLS support 2005-09-07 16:57:50 -07:00
hfsplus [PATCH] Change HFS+ to not use ll_rw_block() 2005-09-07 16:57:56 -07:00
hostfs [PATCH] remove iattr.ia_attr_flags 2005-09-07 16:57:42 -07:00
hpfs
hppfs
hugetlbfs
isofs
jbd [PATCH] Fix race in do_get_write_access() 2005-09-07 16:57:57 -07:00
jffs [PATCH] jffs/jffs2: remove wrong function prototypes 2005-09-07 16:57:29 -07:00
jffs2 [PATCH] jffs/jffs2: remove wrong function prototypes 2005-09-07 16:57:29 -07:00
jfs
lockd
minix
msdos
ncpfs
nfs
nfs_common
nfsd
nls
ntfs
openpromfs
partitions
proc [PATCH] remove duplicated code from proc and ptrace 2005-09-07 16:57:43 -07:00
qnx4
ramfs
reiserfs [PATCH] Change ll_rw_block() calls in Reiser 2005-09-07 16:57:56 -07:00
relayfs
romfs
smbfs
sysfs
sysv
udf
ufs [PATCH] Change ll_rw_block() calls in UFS 2005-09-07 16:57:56 -07:00
vfat
xfs
aio.c
attr.c
bad_inode.c
binfmt_aout.c
binfmt_elf.c
binfmt_elf_fdpic.c
binfmt_em86.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c
binfmt_som.c
bio.c
block_dev.c
buffer.c [PATCH] Make ll_rw_block() wait for buffer lock 2005-09-07 16:57:55 -07:00
char_dev.c
compat.c [PATCH] remove duplicated sys_open32() code from 64bit archs 2005-09-07 16:57:43 -07:00
compat_ioctl.c
dcache.c
dcookies.c
direct-io.c
dnotify.c
dquot.c
eventpoll.c
exec.c
fcntl.c
fifo.c
file.c
file_table.c [PATCH] remove file.f_maxcount 2005-09-07 16:57:32 -07:00
filesystems.c
fs-writeback.c
inode.c [PATCH] fs: remove redundant timespec_equal test in update_atime() 2005-09-07 16:57:31 -07:00
inotify.c [PATCH] inotify: fix event loss on hardlinked files 2005-09-07 16:57:39 -07:00
ioctl.c
ioprio.c
Kconfig [PATCH] fs/Kconfig: quota help text updates 2005-09-07 16:57:29 -07:00
Kconfig.binfmt
libfs.c
locks.c
Makefile
mbcache.c
mpage.c
namei.c [PATCH] namei cleanup 2005-09-07 16:57:42 -07:00
namespace.c [PATCH] Additions to .data.read_mostly section 2005-09-07 16:57:33 -07:00
nfsctl.c
open.c [PATCH] remove duplicated sys_open32() code from 64bit archs 2005-09-07 16:57:43 -07:00
pipe.c [PATCH] pipe: remove redundant fifo_poll abstraction 2005-09-07 16:57:35 -07:00
posix_acl.c
quota.c
quota_v1.c
quota_v2.c
read_write.c [PATCH] remove file.f_maxcount 2005-09-07 16:57:32 -07:00
readdir.c
select.c
seq_file.c
stat.c
super.c
xattr.c
xattr_acl.c