From patchwork Wed Aug 5 09:51:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Hocko X-Patchwork-Id: 6947491 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D64109F358 for ; Wed, 5 Aug 2015 09:55:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C9AEB20384 for ; Wed, 5 Aug 2015 09:55:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F41BB2034A for ; Wed, 5 Aug 2015 09:55:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752798AbbHEJyq (ORCPT ); Wed, 5 Aug 2015 05:54:46 -0400 Received: from mail-wi0-f174.google.com ([209.85.212.174]:35749 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752603AbbHEJvz (ORCPT ); Wed, 5 Aug 2015 05:51:55 -0400 Received: by wibxm9 with SMTP id xm9so200912942wib.0; Wed, 05 Aug 2015 02:51:54 -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=kFyh8zimCTYovcOB6hbOj3ML5GZFA7EIBTVI9aU6//Y=; b=YJVmllyHfCvntmdmOYvsW6lXd7y43C4e4wDFaDL6GcEvGWmrCYiiye3NNy2V3YxugI ifJF6s7FtpIzA+41LhhN2CCTM5gzYgBb30sZHfXNXwlZ5wePstaZu0o82mNENACNLeu8 VnZSzTcAehb0yQA4iq+HIorYI46P1b7f0eHAxIxB8AjGk+pei9LIHTOfk8zutJdd9Ch+ zinzRgl63VDFTfN16AoC0cgl4h94vjbTmyaaREVHBl8ult0UjXio+5m/PMu2d2yOrmyx XCN9pFVp6PUIHJOh6AFPKFO09YBuaO8T5+fHPJ1O8QxOXZz4SS52uXoq2wW2VBfGCD7r P56Q== X-Received: by 10.194.158.34 with SMTP id wr2mr18075147wjb.23.1438768314426; Wed, 05 Aug 2015 02:51:54 -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.53 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 05 Aug 2015 02:51:54 -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 6/8] ext3: Do not abort journal prematurely Date: Wed, 5 Aug 2015 11:51:22 +0200 Message-Id: <1438768284-30927-7-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 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/jbd/transaction.c b/fs/jbd/transaction.c index bf7474deda2f..6c60376a29bc 100644 --- a/fs/jbd/transaction.c +++ b/fs/jbd/transaction.c @@ -887,7 +887,7 @@ int journal_get_undo_access(handle_t *handle, struct buffer_head *bh) repeat: if (!jh->b_committed_data) { - committed_data = jbd_alloc(jh2bh(jh)->b_size, GFP_NOFS); + committed_data = jbd_alloc(jh2bh(jh)->b_size, GFP_NOFS | __GFP_NOFAIL); if (!committed_data) { printk(KERN_ERR "%s: No memory for committed data\n", __func__);