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: 9476211 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 26A0560826 for ; Thu, 15 Dec 2016 14:09:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0338928789 for ; Thu, 15 Dec 2016 14:09:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EBFE228790; Thu, 15 Dec 2016 14:09:50 +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 7597C28789 for ; Thu, 15 Dec 2016 14:09:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758108AbcLOOJS (ORCPT ); Thu, 15 Dec 2016 09:09:18 -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-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 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);