alistair23-linux/fs/ext4
Theodore Ts'o d59729f4e7 ext4: fix races in ext4_sync_parent()
Fix problems if fsync() races against a rename of a parent directory
as pointed out by Al Viro in his own inimitable way:

>While we are at it, could somebody please explain what the hell is ext4
>doing in
>static int ext4_sync_parent(struct inode *inode)
>{
>        struct writeback_control wbc;
>        struct dentry *dentry = NULL;
>        int ret = 0;
>
>        while (inode && ext4_test_inode_state(inode, EXT4_STATE_NEWENTRY)) {
>                ext4_clear_inode_state(inode, EXT4_STATE_NEWENTRY);
>                dentry = list_entry(inode->i_dentry.next,
>                                    struct dentry, d_alias);
>                if (!dentry || !dentry->d_parent || !dentry->d_parent->d_inode)
>                        break;
>                inode = dentry->d_parent->d_inode;
>                ret = sync_mapping_buffers(inode->i_mapping);
>                ...
>Note that dentry obviously can't be NULL there.  dentry->d_parent is never
>NULL.  And dentry->d_parent would better not be negative, for crying out
>loud!  What's worse, there's no guarantees that dentry->d_parent will
>remain our parent over that sync_mapping_buffers() *and* that inode won't
>just be freed under us (after rename() and memory pressure leading to
>eviction of what used to be our dentry->d_parent)......

Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-07-30 12:34:19 -04:00
..
acl.c userns: rename is_owner_or_cap to inode_owner_or_capable 2011-03-23 19:47:13 -07:00
acl.h
balloc.c ext4: refactor duplicated block placement code 2011-06-28 10:01:31 -04:00
bitmap.c
block_validity.c ext4: move ext4_ind_* functions from inode.c to indirect.c 2011-06-27 19:40:50 -04:00
dir.c
ext4.h ext4: let setup_new_group_blocks() set multiple bits at a time 2011-07-26 22:05:53 -04:00
ext4_extents.h ext4: use FIEMAP_EXTENT_LAST flag for last extent in fiemap 2011-06-06 00:06:52 -04:00
ext4_jbd2.c ext4: remove unneeded ext4_journal_get_undo_access 2011-05-09 10:58:45 -04:00
ext4_jbd2.h ext4: remove unneeded ext4_journal_get_undo_access 2011-05-09 10:58:45 -04:00
extents.c ext4: Fix overflow caused by missing cast in ext4_fallocate() 2011-07-27 22:11:20 -04:00
file.c ext4: Convert ext4 to new truncate calling convention 2011-05-25 17:39:48 -04:00
fsync.c ext4: fix races in ext4_sync_parent() 2011-07-30 12:34:19 -04:00
hash.c
ialloc.c Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 2011-03-25 09:57:41 -07:00
indirect.c ext4: refactor duplicated block placement code 2011-06-28 10:01:31 -04:00
inode.c ext4: fix data corruption in inodes with journalled data 2011-07-26 09:07:11 -04:00
ioctl.c ext4: prevent parallel resizers by atomic bit ops 2011-07-26 21:35:44 -04:00
Kconfig
Makefile ext4: move ext4_ind_* functions from inode.c to indirect.c 2011-06-27 19:40:50 -04:00
mballoc.c ext4: let setup_new_group_blocks() set multiple bits at a time 2011-07-26 22:05:53 -04:00
mballoc.h ext4: remove ac_repeats from ext4_allocation_context 2011-07-23 16:18:55 -04:00
migrate.c ext4: set extents flag when migrating file to use extents 2011-05-03 09:34:42 -04:00
mmp.c ext4: add support for multiple mount protection 2011-05-24 18:31:25 -04:00
move_extent.c ext4: Fix max file size and logical block counting of extent format file 2011-06-06 00:05:17 -04:00
namei.c ext4: fix compilation with -DDX_DEBUG 2011-07-16 19:41:23 -04:00
page-io.c ext4: remove loop around bio_alloc() 2011-06-29 21:44:45 -04:00
resize.c ext4: simplify parameters of reserve_backup_gdb() 2011-07-27 21:23:13 -04:00
super.c ext4: prevent parallel resizers by atomic bit ops 2011-07-26 21:35:44 -04:00
symlink.c
truncate.h ext4: move common truncate functions to header file 2011-06-27 19:16:04 -04:00
xattr.c ext4: add flag to ext4_has_free_blocks 2011-05-25 07:41:26 -04:00
xattr.h fs/vfs/security: pass last path component to LSM on inode creation 2011-02-01 11:12:29 -05:00
xattr_security.c fs/vfs/security: pass last path component to LSM on inode creation 2011-02-01 11:12:29 -05:00
xattr_trusted.c
xattr_user.c