Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935117AbcCPIp5 (ORCPT ); Wed, 16 Mar 2016 04:45:57 -0400 Received: from mail.kernel.org ([198.145.29.136]:58958 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965459AbcCPIHC (ORCPT ); Wed, 16 Mar 2016 04:07:02 -0400 From: lizf@kernel.org To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Nikolay Borisov , "Theodore Ts'o" , Zefan Li Subject: [PATCH 3.4 004/107] ext4: avoid deadlocks in the writeback path by using sb_getblk_gfp Date: Wed, 16 Mar 2016 16:04:58 +0800 Message-Id: <1458115601-5762-4-git-send-email-lizf@kernel.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1458115541-5712-1-git-send-email-lizf@kernel.org> References: <1458115541-5712-1-git-send-email-lizf@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1625 Lines: 54 From: Nikolay Borisov 3.4.111-rc1 review patch. If anyone has any objections, please let me know. ------------------ 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 Signed-off-by: Theodore Ts'o [lizf: Backported to 3.4: adjust context] Signed-off-by: Zefan Li --- fs/ext4/extents.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index bbe09a9..e05cb4c 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -699,7 +699,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; @@ -904,7 +905,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; @@ -1088,7 +1089,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); -- 1.9.1