From patchwork Wed Aug 5 09:51:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Hocko X-Patchwork-Id: 6947371 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 43661C05AD for ; Wed, 5 Aug 2015 09:52:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6E4E720377 for ; Wed, 5 Aug 2015 09:52:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BE1CC204AB for ; Wed, 5 Aug 2015 09:52:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752544AbbHEJwB (ORCPT ); Wed, 5 Aug 2015 05:52:01 -0400 Received: from mail-wi0-f175.google.com ([209.85.212.175]:36112 "EHLO mail-wi0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752682AbbHEJv6 (ORCPT ); Wed, 5 Aug 2015 05:51:58 -0400 Received: by wicgj17 with SMTP id gj17so184933567wic.1; Wed, 05 Aug 2015 02:51:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Za98dexLfEM2q2LC4XkgQoNvlmTWRTx2dpXffcg4vVc=; b=N69LHyHaogRTH6a9cfk2W8dWGsnXNN5moN5L0mzmeGgaoAWcj9gSARonj3Z5xBvrwU t9621b1+Hl5coMi2XLzmRL7tv420sFpoYOOMhIT4tjr47wkrtP/qE0it1XOhT3USmxQK e1IaVWU9jqtsC4t4dKW4QuzX4YkGM4HwzKzHNXdf9yjoNDfwXTZkZbcuieggOGb8hTlx MmwPoqvKb4jIS/kGhxKDJBnwOZwwasdcJ09LbLTuIy9PbZ6F1rv+DXwVB0BEZs8iKwf3 M8q7hfIROIP/mWhHlWohkVc2Sb5JTfF+/I2mwVEjTNptOxQFfCTH4AOOeDoLorqWngqS wvsA== X-Received: by 10.194.209.167 with SMTP id mn7mr17426148wjc.64.1438768317086; Wed, 05 Aug 2015 02:51:57 -0700 (PDT) Received: from tiehlicka.suse.cz (nat1.scz.suse.com. [213.151.88.250]) by smtp.gmail.com with ESMTPSA id yu4sm3229106wjc.43.2015.08.05.02.51.56 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 05 Aug 2015 02:51:56 -0700 (PDT) From: mhocko@kernel.org To: LKML Cc: , , Andrew Morton , Johannes Weiner , Tetsuo Handa , Dave Chinner , "Theodore Ts'o" , linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, Jan Kara , Michal Hocko Subject: [RFC 8/8] btrfs: use __GFP_NOFAIL in alloc_btrfs_bio Date: Wed, 5 Aug 2015 11:51:24 +0200 Message-Id: <1438768284-30927-9-git-send-email-mhocko@kernel.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1438768284-30927-1-git-send-email-mhocko@kernel.org> References: <1438768284-30927-1-git-send-email-mhocko@kernel.org> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Michal Hocko alloc_btrfs_bio is relying on GFP_NOFS to allocate a bio but since "mm: page_alloc: do not lock up GFP_NOFS allocations upon OOM" this is allowed to fail which can lead to [ 37.928625] kernel BUG at fs/btrfs/extent_io.c:4045 This is clearly undesirable and the nofail behavior should be explicit if the allocation failure cannot be tolerated. Signed-off-by: Michal Hocko Reviewed-by: David Sterba --- fs/btrfs/volumes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 53af23f2c087..57a99d19533d 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -4914,7 +4914,7 @@ static struct btrfs_bio *alloc_btrfs_bio(int total_stripes, int real_stripes) * and the stripes */ sizeof(u64) * (total_stripes), - GFP_NOFS); + GFP_NOFS|__GFP_NOFAIL); if (!bbio) return NULL;