dm bufio: change __GFP_IO to __GFP_FS in shrinker callbacks
authorMikulas Patocka <mpatocka@redhat.com>
Thu, 16 Oct 2014 18:45:20 +0000 (14:45 -0400)
committerZefan Li <lizefan@huawei.com>
Mon, 2 Feb 2015 09:05:16 +0000 (17:05 +0800)
commit0e7638d87693175cc479b91a8227a27991363cf0
tree3c7e96a9785e052bae4d6592838495acb557d53c
parentd7b1b1db066e9aa59d25ed13c97353a4dbf6ea6c
dm bufio: change __GFP_IO to __GFP_FS in shrinker callbacks

commit 9d28eb12447ee08bb5d1e8bb3195cf20e1ecd1c0 upstream.

The shrinker uses gfp flags to indicate what kind of operation can the
driver wait for. If __GFP_IO flag is present, the driver can wait for
block I/O operations, if __GFP_FS flag is present, the driver can wait on
operations involving the filesystem.

dm-bufio tested for __GFP_IO. However, dm-bufio can run on a loop block
device that makes calls into the filesystem. If __GFP_IO is present and
__GFP_FS isn't, dm-bufio could still block on filesystem operations if it
runs on a loop block device.

The change from __GFP_IO to __GFP_FS supposedly fixes one observed (though
unreproducible) deadlock involving dm-bufio and loop device.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
[lizf: Backported to 3.4:
 - drop changes to dm_bufio_shrink_scan() and dm_bufio_shrink_count()
 - change __GFP_IO to __GFP_FS in shrink()]
Signed-off-by: Zefan Li <lizefan@huawei.com>
drivers/md/dm-bufio.c