From patchwork Fri Jan 6 14:11:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Hocko X-Patchwork-Id: 9501157 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B57136021C for ; Fri, 6 Jan 2017 14:17:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B7E351FFB9 for ; Fri, 6 Jan 2017 14:17:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AADF9205AD; Fri, 6 Jan 2017 14:17:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E9F71FF0B for ; Fri, 6 Jan 2017 14:17:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932647AbdAFOMM (ORCPT ); Fri, 6 Jan 2017 09:12:12 -0500 Received: from mail-wj0-f194.google.com ([209.85.210.194]:34426 "EHLO mail-wj0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932625AbdAFOL0 (ORCPT ); Fri, 6 Jan 2017 09:11:26 -0500 Received: by mail-wj0-f194.google.com with SMTP id qs7so42686624wjc.1; Fri, 06 Jan 2017 06:11:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DyIFu+0B66w/hc7WIfYtswwV4UBWBIx34qV3B8HRICo=; b=DhWM/nBsQOqxBmUf4hehm+6/PXhredU70n+5swUiKksr7spNfdAogifTg6EEca/v/X isxSnP+3m4Nd6GooryRAaQPx7bpzeFXU+S7cg/o//hH2IuYE9YaI3sA4TOB1UxeZi5k/ onytL8VDVZ82aLgByA/AsC62/3wpjxGHqTzVGjhAZO80eenWqjLUSouqjLtD9KTezghe +M1t9g+FROnsOcTfvAJHFnEbm5EOEkvZJi4XIXxyuVmd0vl61hgTNaKT6ZRN8MmAAp/p NXNV1WexWbnMvwnTgs0Vv2w7p5U/J8ecrnOHRHuxmurpvLnmUC8g8g+G3547AW65dYpu XJcw== X-Gm-Message-State: AIkVDXKAnnqX9S1jEqPees7nhzi2EknyLExfKUjIf4PshedWqZ6Wa2PRhFqBION2kSaj/Q== X-Received: by 10.223.150.34 with SMTP id b31mr1130380wra.196.1483711884053; Fri, 06 Jan 2017 06:11:24 -0800 (PST) Received: from tiehlicka.suse.cz ([213.151.95.130]) by smtp.gmail.com with ESMTPSA id b15sm3592642wma.5.2017.01.06.06.11.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jan 2017 06:11:23 -0800 (PST) From: Michal Hocko To: , Cc: Andrew Morton , Dave Chinner , djwong@kernel.org, "Theodore Ts'o" , Chris Mason , David Sterba , Jan Kara , ceph-devel@vger.kernel.org, cluster-devel@redhat.com, linux-nfs@vger.kernel.org, logfs@logfs.org, linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-mtd@lists.infradead.org, reiserfs-devel@vger.kernel.org, linux-ntfs-dev@lists.sourceforge.net, linux-f2fs-devel@lists.sourceforge.net, linux-afs@lists.infradead.org, LKML , Michal Hocko Subject: [PATCH 7/8] Revert "ext4: avoid deadlocks in the writeback path by using sb_getblk_gfp" Date: Fri, 6 Jan 2017 15:11:06 +0100 Message-Id: <20170106141107.23953-8-mhocko@kernel.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170106141107.23953-1-mhocko@kernel.org> References: <20170106141107.23953-1-mhocko@kernel.org> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Michal Hocko This reverts commit c45653c341f5c8a0ce19c8f0ad4678640849cb86 because sb_getblk_gfp is not really needed as sb_getblk __getblk_gfp __getblk_slow grow_buffers grow_dev_page gfp_mask = mapping_gfp_constraint(inode->i_mapping, ~__GFP_FS) | gfp so __GFP_FS is cleared unconditionally and therefore the above commit didn't have any real effect in fact. This patch should not introduce any functional change. The main point of this change is to reduce explicit GFP_NOFS usage inside ext4 code to make the review of the remaining usage easier. Signed-off-by: Michal Hocko Reviewed-by: Jan Kara --- fs/ext4/extents.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 3e295d3350a9..9867b9e5ad8f 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -518,7 +518,7 @@ __read_extent_tree_block(const char *function, unsigned int line, struct buffer_head *bh; int err; - bh = sb_getblk_gfp(inode->i_sb, pblk, __GFP_MOVABLE | GFP_NOFS); + bh = sb_getblk(inode->i_sb, pblk); if (unlikely(!bh)) return ERR_PTR(-ENOMEM); @@ -1096,7 +1096,7 @@ static int ext4_ext_split(handle_t *handle, struct inode *inode, err = -EFSCORRUPTED; goto cleanup; } - bh = sb_getblk_gfp(inode->i_sb, newblock, __GFP_MOVABLE | GFP_NOFS); + bh = sb_getblk(inode->i_sb, newblock); if (unlikely(!bh)) { err = -ENOMEM; goto cleanup; @@ -1290,7 +1290,7 @@ static int ext4_ext_grow_indepth(handle_t *handle, struct inode *inode, if (newblock == 0) return err; - bh = sb_getblk_gfp(inode->i_sb, newblock, __GFP_MOVABLE | GFP_NOFS); + bh = sb_getblk(inode->i_sb, newblock); if (unlikely(!bh)) return -ENOMEM; lock_buffer(bh);