From patchwork Tue Aug 18 10:39:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Hocko X-Patchwork-Id: 7030441 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 E2604C05AD for ; Tue, 18 Aug 2015 10:40:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0FB39206E3 for ; Tue, 18 Aug 2015 10:40:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 34F2D206D6 for ; Tue, 18 Aug 2015 10:40:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752852AbbHRKjm (ORCPT ); Tue, 18 Aug 2015 06:39:42 -0400 Received: from mail-wi0-f175.google.com ([209.85.212.175]:36058 "EHLO mail-wi0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752803AbbHRKjj (ORCPT ); Tue, 18 Aug 2015 06:39:39 -0400 Received: by wicja10 with SMTP id ja10so91235285wic.1; Tue, 18 Aug 2015 03:39:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=geLxU1/R+T9j03suOy4WOLNQgv8vPuHw2Iyac4PYVsI=; b=GL0xbLoEw1zDCxutweQC3TSQPJsRllnkwqYLLZkfgyho5EU6dNmqvKj5PXc9hxM9Fb 7AbYYKLzZXq/n9wzW0+Lqq8kl94u81cgTvaTL1knSoceBdBE6KC4iW8DwTVTQDXYJeec h36XmnfMzE3lyFfEuH/LWnahDrqq5h/WhqoU2kGTk1wUep5+5q7vcRJzwGJvGTzSQRsW 1uL5c5AG+qdhsdqCq9VpHeXGSw3s0u/xwWA0wTmCnGOdjE6WGlx9Pr58eceDm2bTsivM zfX6mH9I9pkZ2qviLoc2RJ1RrQCChqVMoMaqkFGNrP8SOtPk6Zb7bg+DH3l03hcVoeRv osLg== X-Received: by 10.194.21.230 with SMTP id y6mr12732375wje.132.1439894378401; Tue, 18 Aug 2015 03:39:38 -0700 (PDT) Received: from localhost (bband-dyn181.95-103-48.t-com.sk. [95.103.48.181]) by smtp.gmail.com with ESMTPSA id bq7sm25833052wjc.31.2015.08.18.03.39.37 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Aug 2015 03:39:38 -0700 (PDT) Date: Tue, 18 Aug 2015 12:39:37 +0200 From: Michal Hocko To: LKML Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Andrew Morton , Johannes Weiner , Tetsuo Handa , Dave Chinner , Theodore Ts'o , linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, Jan Kara Subject: [RFC -v2 6/8] ext3: Do not abort journal prematurely Message-ID: <20150818103937.GE5033@dhcp22.suse.cz> References: <1438768284-30927-1-git-send-email-mhocko@kernel.org> <1438768284-30927-7-git-send-email-mhocko@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1438768284-30927-7-git-send-email-mhocko@kernel.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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.3 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 journal_get_undo_access is relying on GFP_NOFS allocation yet it is essential for the journal transaction: [ 83.256914] journal_get_undo_access: No memory for committed data [ 83.258022] EXT3-fs: ext3_free_blocks_sb: aborting transaction: Out of memory in __ext3_journal_get_undo_access [ 83.259785] EXT3-fs (hdb1): error in ext3_free_blocks_sb: Out of memory [ 83.267130] Aborting journal on device hdb1. [ 83.292308] EXT3-fs (hdb1): error: ext3_journal_start_sb: Detected aborted journal [ 83.293630] EXT3-fs (hdb1): error: remounting filesystem read-only Since "mm: page_alloc: do not lock up GFP_NOFS allocations upon OOM" these allocation requests are allowed to fail so we need to use __GFP_NOFAIL to imitate the previous behavior. Signed-off-by: Michal Hocko --- fs/jbd/transaction.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/fs/jbd/transaction.c b/fs/jbd/transaction.c index bf7474deda2f..2151b80276c3 100644 --- a/fs/jbd/transaction.c +++ b/fs/jbd/transaction.c @@ -886,15 +886,8 @@ int journal_get_undo_access(handle_t *handle, struct buffer_head *bh) goto out; repeat: - if (!jh->b_committed_data) { - committed_data = jbd_alloc(jh2bh(jh)->b_size, GFP_NOFS); - if (!committed_data) { - printk(KERN_ERR "%s: No memory for committed data\n", - __func__); - err = -ENOMEM; - goto out; - } - } + if (!jh->b_committed_data) + committed_data = jbd_alloc(jh2bh(jh)->b_size, GFP_NOFS | __GFP_NOFAIL); jbd_lock_bh_state(bh); if (!jh->b_committed_data) {