Add "add-gfp-version-for-sb_getblk" and "use-sb_get_gfp" patches
[ext4-patch-queue.git] / use-sb_getblk_gfp
blob2b1573b38f73305ae3ec2f19214aa2693a5f191f
1 ext4: avoid deadlocks in the writeback path by using sb_getblk_gfp
3 From: Nikolay Borisov <kernel@kyup.com>
5 Switch ext4 to using sb_getblk_gfp with GFP_NOFS added to fix possible
6 deadlocks in the page writeback path.
8 Signed-off-by: Nikolay Borisov <kernel@kyup.com>
9 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 Cc: stable@vger.kernel.org
11 ---
12  fs/ext4/extents.c |    6 +++---
13  1 files changed, 3 insertions(+), 3 deletions(-)
15 diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
16 index e003a1e..87ba10d 100644
17 --- a/fs/ext4/extents.c
18 +++ b/fs/ext4/extents.c
19 @@ -503,7 +503,7 @@ __read_extent_tree_block(const char *function, unsigned int line,
20         struct buffer_head              *bh;
21         int                             err;
23 -       bh = sb_getblk(inode->i_sb, pblk);
24 +       bh = sb_getblk_gfp(inode->i_sb, pblk, __GFP_MOVABLE | GFP_NOFS);
25         if (unlikely(!bh))
26                 return ERR_PTR(-ENOMEM);
28 @@ -1088,7 +1088,7 @@ static int ext4_ext_split(handle_t *handle, struct inode *inode,
29                 err = -EIO;
30                 goto cleanup;
31         }
32 -       bh = sb_getblk(inode->i_sb, newblock);
33 +       bh = sb_getblk_gfp(inode->i_sb, newblock, __GFP_MOVABLE | GFP_NOFS);
34         if (unlikely(!bh)) {
35                 err = -ENOMEM;
36                 goto cleanup;
37 @@ -1282,7 +1282,7 @@ static int ext4_ext_grow_indepth(handle_t *handle, struct inode *inode,
38         if (newblock == 0)
39                 return err;
41 -       bh = sb_getblk(inode->i_sb, newblock);
42 +       bh = sb_getblk_gfp(inode->i_sb, newblock, __GFP_MOVABLE | GFP_NOFS);
43         if (unlikely(!bh))
44                 return -ENOMEM;
45         lock_buffer(bh);
46 -- 
47 1.7.1
50 To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
51 the body of a message to majordomo@vger.kernel.org
52 More majordomo info at  http://vger.kernel.org/majordomo-info.html