aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cachefiles
diff options
context:
space:
mode:
authorJiaying Zhang <jiayingz@google.com>2011-08-13 12:17:13 -0400
committerTheodore Ts'o <tytso@mit.edu>2011-08-13 12:17:13 -0400
commit2581fdc810889fdea97689cb62481201d579c796 (patch)
tree55d7a2244a5efa184e290446c0ee3f61b71bf264 /fs/cachefiles
parent441c850857148935babe000fc2ba1455fe54a6a9 (diff)
downloadkernel_goldelico_gta04-2581fdc810889fdea97689cb62481201d579c796.zip
kernel_goldelico_gta04-2581fdc810889fdea97689cb62481201d579c796.tar.gz
kernel_goldelico_gta04-2581fdc810889fdea97689cb62481201d579c796.tar.bz2
ext4: call ext4_ioend_wait and ext4_flush_completed_IO in ext4_evict_inode
Flush inode's i_completed_io_list before calling ext4_io_wait to prevent the following deadlock scenario: A page fault happens while some process is writing inode A. During page fault, shrink_icache_memory is called that in turn evicts another inode B. Inode B has some pending io_end work so it calls ext4_ioend_wait() that waits for inode B's i_ioend_count to become zero. However, inode B's ioend work was queued behind some of inode A's ioend work on the same cpu's ext4-dio-unwritten workqueue. As the ext4-dio-unwritten thread on that cpu is processing inode A's ioend work, it tries to grab inode A's i_mutex lock. Since the i_mutex lock of inode A is still hold before the page fault happened, we enter a deadlock. Also moves ext4_flush_completed_IO and ext4_ioend_wait from ext4_destroy_inode() to ext4_evict_inode(). During inode deleteion, ext4_evict_inode() is called before ext4_destroy_inode() and in ext4_evict_inode(), we may call ext4_truncate() without holding i_mutex lock. As a result, there is a race between flush_completed_IO that is called from ext4_ext_truncate() and ext4_end_io_work, which may cause corruption on an io_end structure. This change moves ext4_flush_completed_IO and ext4_ioend_wait from ext4_destroy_inode() to ext4_evict_inode() to resolve the race between ext4_truncate() and ext4_end_io_work during inode deletion. Signed-off-by: Jiaying Zhang <jiayingz@google.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Cc: stable@kernel.org
Diffstat (limited to 'fs/cachefiles')
0 files changed, 0 insertions, 0 deletions