Received: by 10.192.165.148 with SMTP id m20csp2445385imm; Sun, 22 Apr 2018 07:13:40 -0700 (PDT) X-Google-Smtp-Source: AIpwx48xdkSfJIMvclldpzGGo5BO/zgVaSPPXJWwCJjHELcX7q+KV115bcmowk6l171pmvu/aS2m X-Received: by 10.101.82.133 with SMTP id y5mr14206990pgp.27.1524406420040; Sun, 22 Apr 2018 07:13:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524406420; cv=none; d=google.com; s=arc-20160816; b=VgzekL9Shmb1VbC+lGW0J5fFg0etjZ8usHDuo/Xefl8oZP6mQ3Emv80eKG6r+sE3SH upFIoDFNEmibAGaPVcebZkoYC6fCLMJ2NdGQvxTeitLjrdbqiWiC6OeC7W0c5b5c2NjD F6gOBZli3NpHj9p077wEk8C8WYobRwt9PZTE4cn+a+UpnrT1nh2eSk/9CWdfPLPJfnY5 56C9lF4t1L5cwbcsTS/EI4/Gjw5KLyh+l2tuKcMuXC8zH3Yv7fMaaa8q3heIRywjdVe2 4xvuUYbXcc/urBw/FaGxEt+owVOGwP4pSPKoJ1l+TM8hAXe7oak0D7oRWN1U8EtX1RRc aFHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=83eHG4a+TiPB44+Imus61DTK/DEyjLAl0ZlpUOtZTgo=; b=OcXKpbOK8bkyR+Gwx795STK9vzAij9SA51G8fVGhPvn+E3LLw36+ScwflPYoWFqMpR vVt860RJEgTvfNs77QeSVcEBehdSZnwGuj1zUdumMWk16CHFmTY2K3AUmAB41HANw2td Fm8oudoceMz3nwHE1NXgzasgeiC0EHqXZe/u/sXchVbSd+8wVSrxokEwEY9zv1nRxmJL EErSy0QOOIxSfgrYTU2Qr9PVmVSfpx2A4WZobhQtYMAl4KejAitnZ2VAXkc/2/y7aeMI oZJ0IjsQD8IdbELHpmbYFOdh9RXG2EYCEtPntyzfij1pjpcwLnRnMHN4TeAhlTMAmRDg TvWA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b34-v6si9579795plc.53.2018.04.22.07.13.25; Sun, 22 Apr 2018 07:13:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756685AbeDVOMa (ORCPT + 99 others); Sun, 22 Apr 2018 10:12:30 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:54936 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755657AbeDVOMP (ORCPT ); Sun, 22 Apr 2018 10:12:15 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id DF361CB7; Sun, 22 Apr 2018 14:12:14 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Theodore Tso Subject: [PATCH 4.9 34/95] jbd2: if the journal is aborted then dont allow update of the log tail Date: Sun, 22 Apr 2018 15:53:03 +0200 Message-Id: <20180422135211.826438494@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135210.432103639@linuxfoundation.org> References: <20180422135210.432103639@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Theodore Ts'o commit 85e0c4e89c1b864e763c4e3bb15d0b6d501ad5d9 upstream. This updates the jbd2 superblock unnecessarily, and on an abort we shouldn't truncate the log. Signed-off-by: Theodore Ts'o Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- fs/jbd2/journal.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -951,7 +951,7 @@ out: } /* - * This is a variaon of __jbd2_update_log_tail which checks for validity of + * This is a variation of __jbd2_update_log_tail which checks for validity of * provided log tail and locks j_checkpoint_mutex. So it is safe against races * with other threads updating log tail. */ @@ -1394,6 +1394,9 @@ int jbd2_journal_update_sb_log_tail(jour journal_superblock_t *sb = journal->j_superblock; int ret; + if (is_journal_aborted(journal)) + return -EIO; + BUG_ON(!mutex_is_locked(&journal->j_checkpoint_mutex)); jbd_debug(1, "JBD2: updating superblock (start %lu, seq %u)\n", tail_block, tail_tid);