ext4: avoid potential hang in mpage_submit_io() when blocksize < pagesize
commit8fe5e8ff93473129957c6d4a7df80046186b9c7b
authorYongqiang Yang <xiaoqiangnk@gmail.com>
Wed, 14 Dec 2011 02:51:55 +0000 (13 21:51 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 21 Dec 2011 20:57:44 +0000 (21 12:57 -0800)
tree9561105270aeec6e9c28fc3cbb430040a5be6ca7
parentdda54df863232231ce851045834f475f02a7e565
ext4: avoid potential hang in mpage_submit_io() when blocksize < pagesize

commit 13a79a4741d37fda2fbafb953f0f301dc007928f upstream.

If there is an unwritten but clean buffer in a page and there is a
dirty buffer after the buffer, then mpage_submit_io does not write the
dirty buffer out.  As a result, da_writepages loops forever.

This patch fixes the problem by checking dirty flag.

Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/ext4/inode.c