Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp5986602pxv; Wed, 7 Jul 2021 16:55:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLPt6GwXyZMW/vg2/+LrnY+ap9K/JXwvg3ywsgyoXVDMoPWTt8vCAC35MugXq/5D/cYBI8 X-Received: by 2002:a05:6402:1c99:: with SMTP id cy25mr27007279edb.148.1625702134553; Wed, 07 Jul 2021 16:55:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625702134; cv=none; d=google.com; s=arc-20160816; b=PmGh89EcjVWipa6HEduCP9NPw/Ij2QcmkAcn4+MhDbH9z7eKvpNW4ILeZ7R2849AN+ oO/4jqRCo4KMwQWA38vrAIx7uW0JQK5uf/4vvO/+x3REOqwl8tB3LSZ87e9lzlm7Qjdc PJt7tHUEgULI/0O6zOpJIzIAQ/pxBNRX0yP4n5uBzo8j/OD7qYKAWE1smc//L3+MGRJQ 7TZ8t6eG9ynwV4+8Tng4/Dteqbah7Gl7EDMV7419sbaUfU1DimAZ02GTA1A44POah22W rpZGnJwTQT5MwEBHCN+XZihIi1TwKXetNFks/vqB4NOHiVcDi8KRxMgjIOwzjlJpDJUm TqSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=FY3wUyKwHhvrglktLOxC0embSRMSqW5jfUGbm6WrJ34=; b=cLEZ70LKgJOVvlg0dXUwI196ACbz2VaPUpjqG6fYNIZ9sPeKz3YF2bIoVQzPVC/mkQ ZixTGVsH1ACKkFkTC7Wfq8X51ZCIluAnzAiERqI4Vhy3mOxnnD31Zr8VD3KQIO6dDt07 eTedh+qXCsI+6wKFamKvZPnUlg+Y+UOyuZp8jSgQQd3+Ls3mnRXq/LWJosUBZ+mcGnc3 y+69TdFi9P/fRnQ2+6PlOtQSprUkUHMqBKf4rvK1IazVWj+9RhEvaYyZXG/iOw6GFXGJ 4jSkCx2bMsTUlMiQoirBtaHuW4WhEN1mtcWoyNdE4W42PP5hjU00xePVugeV858wE4xR Flrg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l14si559290ejo.578.2021.07.07.16.55.01; Wed, 07 Jul 2021 16:55:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229729AbhGGXz0 (ORCPT + 99 others); Wed, 7 Jul 2021 19:55:26 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:55056 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229519AbhGGXz0 (ORCPT ); Wed, 7 Jul 2021 19:55:26 -0400 Received: from cwcc.thunk.org (pool-72-74-133-215.bstnma.fios.verizon.net [72.74.133.215]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 167NqfuW015376 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 7 Jul 2021 19:52:41 -0400 Received: by cwcc.thunk.org (Postfix, from userid 15806) id 2ED0115C3CC6; Wed, 7 Jul 2021 19:52:41 -0400 (EDT) Date: Wed, 7 Jul 2021 19:52:41 -0400 From: "Theodore Ts'o" To: Ivan Zahariev Cc: linux-ext4@vger.kernel.org Subject: Re: jbd2: fix deadlock while checkpoint thread waits commit thread to finish (backport to 4.14) Message-ID: References: <3221ced0-e8f3-53da-3474-28367272f35d@famzah.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3221ced0-e8f3-53da-3474-28367272f35d@famzah.net> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Jul 07, 2021 at 09:42:25PM +0300, Ivan Zahariev wrote: > Hello, > > We're running Linux kernel 4.14.x and our systems occasionally suffer a bug > which is already fixed: https://github.com/torvalds/linux/commit/53cf978457325d8fb2cdecd7981b31a8229e446e > > This bugfix hasn't been ported to Linux kernels 4.14 or 4.19. The patch > applies cleanly. The two files "fs/jbd2/checkpoint.c" and > "fs/jbd2/journal.c" seem pretty identical in the affected sections compared > to kernel 5.4 where we have this bugfix already applied. > > Is it on purpose that this bugfix hasn't been ported to 4.14? Is it safe > that we backport it manually in our kernel 4.14 builds? Or is the "ext4" > system in 4.14 and 5.4 fundamentally different and this would lead to data > loss or other problems? The commit was over two years ago, so my memory is not going to be perfect. However, Jan had made a comment suggesting the approach in this commit because it should be easier to backport into older stble kernels[1]. "Since proper locking change is going to be a bit more involved, can you perhaps fix this deadlock by just dropping j_checkpoint_mutex in log_do_checkpoint() when we are going to wait for transaction commit. I've checked and that should be fine and that is going to be much easier change to backport into stable kernels..." [1] https://marc.info/?l=linux-ext4&m=154212553014669&w=2 So I suspect it was just that I failed to remember to add a "Cc: stable@kernel.org" and so it was never automatically backported into 4.14 or 4.19. Do you have a reliable reproduction which is triggering the deadlock on your kernels? If so, have you tried applying the patch and does it make the problem go away for you? Cheers, - Ted