summaryrefslogtreecommitdiffstats
path: root/fs/ext4/extents.c
diff options
context:
space:
mode:
authorNikolay Borisov <kernel@kyup.com>2015-07-02 01:34:07 -0400
committerTheodore Ts'o <tytso@mit.edu>2015-07-02 01:34:07 -0400
commitc45653c341f5c8a0ce19c8f0ad4678640849cb86 (patch)
treed57e0b0ba55d14ceb27aa7b2831341e68a5deeca /fs/ext4/extents.c
parentbd7ade3cd9b0850264306f5c2b79024a417b6396 (diff)
ext4: avoid deadlocks in the writeback path by using sb_getblk_gfp
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> Cc: stable@vger.kernel.org
Diffstat (limited to 'fs/ext4/extents.c')
-rw-r--r--fs/ext4/extents.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index d86d2622f826..69af30e0d75d 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -503,7 +503,7 @@ __read_extent_tree_block(const char *function, unsigned int line,
503 struct buffer_head *bh; 503 struct buffer_head *bh;
504 int err; 504 int err;
505 505
506 bh = sb_getblk(inode->i_sb, pblk); 506 bh = sb_getblk_gfp(inode->i_sb, pblk, __GFP_MOVABLE | GFP_NOFS);
507 if (unlikely(!bh)) 507 if (unlikely(!bh))
508 return ERR_PTR(-ENOMEM); 508 return ERR_PTR(-ENOMEM);
509 509
@@ -1088,7 +1088,7 @@ static int ext4_ext_split(handle_t *handle, struct inode *inode,
1088 err = -EIO; 1088 err = -EIO;
1089 goto cleanup; 1089 goto cleanup;
1090 } 1090 }
1091 bh = sb_getblk(inode->i_sb, newblock); 1091 bh = sb_getblk_gfp(inode->i_sb, newblock, __GFP_MOVABLE | GFP_NOFS);
1092 if (unlikely(!bh)) { 1092 if (unlikely(!bh)) {
1093 err = -ENOMEM; 1093 err = -ENOMEM;
1094 goto cleanup; 1094 goto cleanup;
@@ -1282,7 +1282,7 @@ static int ext4_ext_grow_indepth(handle_t *handle, struct inode *inode,
1282 if (newblock == 0) 1282 if (newblock == 0)
1283 return err; 1283 return err;
1284 1284
1285 bh = sb_getblk(inode->i_sb, newblock); 1285 bh = sb_getblk_gfp(inode->i_sb, newblock, __GFP_MOVABLE | GFP_NOFS);
1286 if (unlikely(!bh)) 1286 if (unlikely(!bh))
1287 return -ENOMEM; 1287 return -ENOMEM;
1288 lock_buffer(bh); 1288 lock_buffer(bh);