From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40C48C10F14 for ; Thu, 3 Oct 2019 16:22:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0DC4C21783 for ; Thu, 3 Oct 2019 16:22:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570119766; bh=oMEZALGYqpjAmf3M/soEiS5nERz2JiuJz1YaMlXvuv4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ylBwwDM1JDSL3Xau1/bS6t6vwUjgP+67LYLY5z/xudJJOb9y3itru7G3nzGRgteND QBoPIopkRb4Wsq25PKa3q/e8mMCoYfrcNIdwXaLB/V5PPrVpvp/voB7XnAf+MQC9IT l44Vkwv12g0HI72Ti+04/WWMyGTD0qK2y1YTPJtI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390372AbfJCQWo (ORCPT ); Thu, 3 Oct 2019 12:22:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:51432 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390347AbfJCQWj (ORCPT ); Thu, 3 Oct 2019 12:22:39 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 42FD3222BE; Thu, 3 Oct 2019 16:22:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570119758; bh=oMEZALGYqpjAmf3M/soEiS5nERz2JiuJz1YaMlXvuv4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RQgVZ3Gzo+rV9Ve8cCHNAb0aJNagd9ktDhGMpE+g8IVo1094fzUVs8vlo2fNINwvw 9AmQvtLcNXs0aIbe0xbYigNRve4YrSNrhY+bLWEDBv1WSf63QkL34lV0RGHwwQEEQS SuI63+axdroNcNb9jeOW8frczKedOAADasSKBiiU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bob Peterson , Andreas Gruenbacher Subject: [PATCH 4.19 182/211] gfs2: clear buf_in_tr when ending a transaction in sweep_bh_for_rgrps Date: Thu, 3 Oct 2019 17:54:08 +0200 Message-Id: <20191003154527.528197361@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154447.010950442@linuxfoundation.org> References: <20191003154447.010950442@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bob Peterson commit f0b444b349e33ae0d3dd93e25ca365482a5d17d4 upstream. In function sweep_bh_for_rgrps, which is a helper for punch_hole, it uses variable buf_in_tr to keep track of when it needs to commit pending block frees on a partial delete that overflows the transaction created for the delete. The problem is that the variable was initialized at the start of function sweep_bh_for_rgrps but it was never cleared, even when starting a new transaction. This patch reinitializes the variable when the transaction is ended, so the next transaction starts out with it cleared. Fixes: d552a2b9b33e ("GFS2: Non-recursive delete") Cc: stable@vger.kernel.org # v4.12+ Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher Signed-off-by: Greg Kroah-Hartman --- fs/gfs2/bmap.c | 1 + 1 file changed, 1 insertion(+) --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c @@ -1630,6 +1630,7 @@ out_unlock: brelse(dibh); up_write(&ip->i_rw_mutex); gfs2_trans_end(sdp); + buf_in_tr = false; } gfs2_glock_dq_uninit(rd_gh); cond_resched();