kernel-ark/fs
Linus Torvalds 1be62dc190 Be more careful about marking buffers dirty
Mikulas Patocka noted that the optimization where we check if a buffer
was already dirty (and we avoid re-dirtying it) was not really SMP-safe.

Since the read of the old status was not synchronized with anything, an
aggressive CPU re-ordering of memory accesses might have moved that read
up to before the data was even written to the buffer, and another CPU
that cleaned it again, causing the newly dirty state to never actually
hit the disk.

Admittedly this would probably never trigger in practice, but it's still
wrong.

Mikulas sent a patch that fixed the problem, but I dislike the subtlety
of the whole optimization, so this is an alternate fix that is more
explicit about the particular SMP ordering for the optimization, and
separates out the speculative reads of the buffer state into its own
conditional (and makes the memory barrier only happen if we are likely
to actually hit the optimized case in the first place).

I considered removing the optimization entirely, but Andrew argued for
it's continued existence. I'm a push-over.

Cc: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-04 14:38:17 -07:00
..
9p
adfs
affs
afs afs: remove smp_prcessor_id() from debug macro 2008-04-03 15:40:53 -07:00
autofs
autofs4
befs
bfs
cifs cifs: fix misannotations 2008-03-30 14:20:23 -07:00
coda
configfs
cramfs
debugfs
devpts
dlm
ecryptfs eCryptfs: Swap dput() and mntput() 2008-03-19 18:53:36 -07:00
efs efs: update error msg to not refer to deleted read_inode() 2008-04-02 15:28:19 -07:00
exportfs
ext2
ext3 ext3: fix wrong gfp type under transaction 2008-03-19 18:53:36 -07:00
ext4
fat
freevxfs
fuse
gfs2
hfs hfs_bnode_find() can fail, resulting in hfs_bnode_split() breakage 2008-03-17 09:46:55 -07:00
hfsplus
hostfs
hpfs
hppfs [PATCH] sanitize hppfs 2008-03-19 06:42:18 -04:00
hugetlbfs [PATCH] double iput() on failure exit in hugetlb 2008-03-19 06:55:01 -04:00
isofs zisofs: fix readpage() outside i_size 2008-03-19 18:53:36 -07:00
jbd jbd/jbd2 NULL noise 2008-03-30 14:18:41 -07:00
jbd2 jbd/jbd2 NULL noise 2008-03-30 14:18:41 -07:00
jffs2
jfs
lockd
minix
msdos
ncpfs
nfs [PATCH] do shrink_submounts() for all fs types 2008-03-27 20:47:58 -04:00
nfs_common
nfsd nfsd: fix oops on access from high-numbered ports 2008-03-14 16:49:15 -07:00
nls
ntfs
ocfs2 ocfs2: Fix NULL pointer dereferences in o2net 2008-03-10 15:14:19 -07:00
openpromfs
partitions
proc Change pagemap output format to allow for future reporting of huge pages 2008-03-22 17:03:10 -07:00
qnx4
ramfs
reiserfs NULL noise: fs/*, mm/*, kernel/* 2008-03-30 14:18:41 -07:00
romfs ROMFS: Fix up an error in iget removal 2008-03-19 18:53:36 -07:00
smbfs NULL noise: fs/*, mm/*, kernel/* 2008-03-30 14:18:41 -07:00
sysfs driver core: debug for bad dev_attr_show() return value. 2008-03-24 22:33:49 -07:00
sysv
udf
ufs fs/ufs/balloc.c: fix sparc64 printk warning 2008-03-19 18:53:37 -07:00
vfat
xfs
aio.c aio: bad AIO race in aio_complete() leads to process hang 2008-03-19 18:53:35 -07:00
anon_inodes.c [PATCH] fix up new filp allocators 2008-03-19 06:54:05 -04:00
attr.c
bad_inode.c
binfmt_aout.c
binfmt_elf_fdpic.c
binfmt_elf.c
binfmt_em86.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c
binfmt_som.c
bio.c Revert "unexport bio_{,un}map_user" 2008-03-17 21:14:40 +01:00
block_dev.c
buffer.c Be more careful about marking buffers dirty 2008-04-04 14:38:17 -07:00
char_dev.c
compat_binfmt_elf.c
compat_ioctl.c
compat.c
dcache.c
dcookies.c
direct-io.c
dnotify.c
dquot.c quota: add possibly missing iput() when quotaon and quotaoff races 2008-03-19 18:53:35 -07:00
drop_caches.c
eventfd.c
eventpoll.c
exec.c
fcntl.c
fifo.c
file_table.c [PATCH] fix up new filp allocators 2008-03-19 06:54:05 -04:00
file.c
filesystems.c
fs-writeback.c fs: fix kernel-doc notation warnings 2008-03-19 18:53:36 -07:00
generic_acl.c
inode.c
inotify_user.c
inotify.c
internal.h
ioctl.c
ioprio.c
Kconfig
Kconfig.binfmt
libfs.c
locks.c fs: fix kernel-doc notation warnings 2008-03-19 18:53:36 -07:00
Makefile
mbcache.c
mpage.c
namei.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 2008-03-25 08:57:47 -07:00
namespace.c [PATCH] mnt_expire is protected by namespace_sem, no need for vfsmount_lock 2008-03-27 20:48:04 -04:00
nfsctl.c
no-block.c
open.c [PATCH] check for null vfsmount in dentry_open() 2008-03-19 06:50:44 -04:00
pipe.c [PATCH] fix up new filp allocators 2008-03-19 06:54:05 -04:00
pnode.c [PATCH] count ghost references to vfsmounts 2008-03-27 20:47:46 -04:00
pnode.h
posix_acl.c
quota_v1.c
quota_v2.c
quota.c
read_write.c
read_write.h
readdir.c
select.c
seq_file.c
signalfd.c
splice.c splice: use mapping_gfp_mask 2008-04-03 15:39:49 -07:00
stack.c
stat.c
super.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 2008-03-25 08:57:47 -07:00
sync.c
timerfd.c
utimes.c
xattr_acl.c
xattr.c