1
linux/fs/ext4
Aneesh Kumar K.V 267e4db9ac ext4: Fix race between migration and mmap write
Fail migrate if we allocated new blocks via mmap write.

If we write to holes in the file via mmap, we end up allocating
new blocks. This block allocation happens without taking inode->i_mutex.
Since migrate is protected by i_mutex and migrate expects that no
new blocks get allocated during migrate, fail migrate if new blocks
get allocated.

We can't take inode->i_mutex in the mmap write path because that
would result in a locking order violation between i_mutex and mmap_sem.
Also adding a separate rw_sempahore for protection is really high overhead
for a rare operation such as migrate.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Acked-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-29 08:11:12 -04:00
..
acl.c
acl.h
balloc.c
bitmap.c
dir.c
ext4_jbd2.c
extents.c ext4: ENOSPC error handling for writing to an uninitialized extent 2008-04-29 08:11:12 -04:00
file.c
fsync.c
group.h
hash.c
ialloc.c ext4: Enable extent format for symlinks. 2008-04-29 08:11:12 -04:00
inode.c ext4: Fix race between migration and mmap write 2008-04-29 08:11:12 -04:00
ioctl.c
Makefile
mballoc.c ext4: use non-racy method for proc entries creation 2008-04-29 08:06:20 -07:00
migrate.c ext4: Fix race between migration and mmap write 2008-04-29 08:11:12 -04:00
namei.c ext4: Enable extent format for symlinks. 2008-04-29 08:11:12 -04:00
namei.h
resize.c
super.c ext4: fix mount option parsing 2008-04-29 22:05:28 -04:00
symlink.c
xattr_security.c
xattr_trusted.c
xattr_user.c
xattr.c
xattr.h