diff options
author | Nikolay Borisov <kernel@kyup.com> | 2015-07-02 01:34:07 -0400 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2015-08-12 16:33:19 +0200 |
commit | d612a04deae8a70636a2fced4fdd0bb94dfb6219 (patch) | |
tree | 82212766ebf7863e37c8ebd555400c06ab81bb55 /fs | |
parent | 786d7b3d2d1096c893e0fda85126c3972c98b027 (diff) |
ext4: avoid deadlocks in the writeback path by using sb_getblk_gfp
commit c45653c341f5c8a0ce19c8f0ad4678640849cb86 upstream.
Switch ext4 to using sb_getblk_gfp with GFP_NOFS added to fix possible
deadlocks in the page writeback path.
Signed-off-by: Nikolay Borisov <kernel@kyup.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext4/extents.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 2da63ab7c416..e3d65abb41b3 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -700,7 +700,8 @@ ext4_ext_find_extent(struct inode *inode, ext4_lblk_t block, path[ppos].p_depth = i; path[ppos].p_ext = NULL; - bh = sb_getblk(inode->i_sb, path[ppos].p_block); + bh = sb_getblk_gfp(inode->i_sb, path[ppos].p_block, + __GFP_MOVABLE | GFP_NOFS); if (unlikely(!bh)) { ret = -ENOMEM; goto err; @@ -905,7 +906,7 @@ static int ext4_ext_split(handle_t *handle, struct inode *inode, err = -EIO; goto cleanup; } - bh = sb_getblk(inode->i_sb, newblock); + bh = sb_getblk_gfp(inode->i_sb, newblock, __GFP_MOVABLE | GFP_NOFS); if (!bh) { err = -ENOMEM; goto cleanup; @@ -1089,7 +1090,7 @@ static int ext4_ext_grow_indepth(handle_t *handle, struct inode *inode, if (newblock == 0) return err; - bh = sb_getblk(inode->i_sb, newblock); + bh = sb_getblk_gfp(inode->i_sb, newblock, __GFP_MOVABLE | GFP_NOFS); if (!bh) return -ENOMEM; lock_buffer(bh); |