From patchwork Thu Dec 15 14:07:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Hocko X-Patchwork-Id: 9486825 X-Mozilla-Keys: nonjunk Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on sandeen.net X-Spam-Level: X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 X-Spam-HP: BAYES_00=-1.9,RCVD_IN_DNSWL_HI=-5,RP_MATCHES_RCVD=-0.1, URIBL_BLOCKED=0.001 X-Original-To: sandeen@sandeen.net Delivered-To: sandeen@sandeen.net Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by sandeen.net (Postfix) with ESMTP id CF93987 for ; Thu, 15 Dec 2016 08:09:25 -0600 (CST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758124AbcLOOJU (ORCPT ); Thu, 15 Dec 2016 09:09:20 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:35245 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757941AbcLOOIA (ORCPT ); Thu, 15 Dec 2016 09:08:00 -0500 Received: by mail-wm0-f68.google.com with SMTP id a20so6739233wme.2; Thu, 15 Dec 2016 06:07:58 -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=U24YiEO6F83pdfuxGpJs8QEn2/pjYYQKOhjDt6T2OQs=; b=e4svZWXWrUYrrNeURRSa1nygtgOg9EdmWhTnO/L9mneUfrJi0QkZm/LwfhLH2lWpXs bo9SkyZq+QQt7c+WwqiTS86Py5kJHwBQrWp3SkarQl/3nb10PZ4MaOw2j0MdMi2+JlbV wxEytC2x3V7xrvyXOxv0SdU1wjmelRnzfgTXqdWq8RTYFUJr8oUnddqxAAqG3oOEs26e EymTOpr0Og97lUYGfrL/HMec6Z43yViZ3YosV5NVUJhLi88zTX7InWQFEgb56OjhBHNi GU/TsABWODsKjnrawBRET3f4RKEaTFEumKv+voYWUvr52L0Iw64MOmkuSpn+42Fxcea4 dtCA== X-Gm-Message-State: AIkVDXLXO5NhjEhNJC3PeK2w+km1VM/KnoOdZfys/dj5pMDt2PCAUcX+0lKySgOFFNOiZA== X-Received: by 10.28.214.84 with SMTP id n81mr1563667wmg.120.1481810877601; Thu, 15 Dec 2016 06:07:57 -0800 (PST) Received: from tiehlicka.suse.cz ([213.151.95.130]) by smtp.gmail.com with ESMTPSA id d8sm12646880wmi.21.2016.12.15.06.07.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Dec 2016 06:07:57 -0800 (PST) From: Michal Hocko To: , Cc: Andrew Morton , Dave Chinner , "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 8/9] Revert "ext4: avoid deadlocks in the writeback path by using sb_getblk_gfp" Date: Thu, 15 Dec 2016 15:07:14 +0100 Message-Id: <20161215140715.12732-9-mhocko@kernel.org> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161215140715.12732-1-mhocko@kernel.org> References: <20161215140715.12732-1-mhocko@kernel.org> Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org 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 --- 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 b1f8416923ab..ef815eb72389 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);