Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7269258rdb; Wed, 3 Jan 2024 09:54:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IHvKYCXiMdhQNONHrqZ+nZ2vHWZlOPHjUboJzehGbVCFl3b4VHop6RN3l6V5/JIw8GceFsS X-Received: by 2002:a05:620a:a50:b0:781:b318:597c with SMTP id j16-20020a05620a0a5000b00781b318597cmr7253214qka.56.1704304467192; Wed, 03 Jan 2024 09:54:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704304467; cv=none; d=google.com; s=arc-20160816; b=QpAq1zAOcKxOsrRL202QdkgrM213/9RDSktg9WQebtautvRwB2Fj430tA+uDI5rtBN Bq4+T4JP1CvBNWXYChQomPqB6Z+6Q3B/y55WAtxayoPkBr2BQrEWmfoTfDEKDzw12YLB WvnX7oyWJ7ZJusAT39DJHE4LKhgyeTW2e8eUskexKGnEzEMq13T+Pvdvzr7kCAgksXNf Q0b4eanVELhmP/lS5BpU0J9ghvccy8cGVq8P3pWSuqa0V5HHh7gYwxhW37hC0GZDMudw +fAX+WF10T2qgMePUsyHqjR+ajIFcmwFIB0sgy5FsTj4kVBRcbCwJH3JmRYcfShP4HDQ K0xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=g3Q6A/OSBTzpvsA+ZueyJpCCrUPX6Gs2jbB2LOMyGZU=; fh=VYfFV0qGCSDtIM3nhKzqXzUIkJ3M8zyjNIkvX0xjs4s=; b=JQ0nizbjKVhPbjWNXd/6NLo+cnWhsAob6gjIfsYfOue5WAgiLB4QIikP/DsCwSaMj1 ixAvESgvydJ7g/TaIXVh4BEuz1+bAbgeNyK4ICyyYOpLd3d0MMvj1lJO118+jdPrDLTy cM2/Y95WYU0ory3dfvL8wnPYPLuZqp5coy5Qh9Gw684iL1Yu2/a0A+Xr0huG3fTF81yG R8WQpCr11j6jFii7YomDVLyI0x6ssS1uTxw8HS1wOUXsY78LgsuQ1+jNlt20CD0UdHNE X1qhyHtOBYBpDVTxfBwfke97OUlai3OjMKDdQhjBeiF9xuiwmkZ6kZF2+fV8a2NEMzwC oudw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=L1kvXiEP; spf=pass (google.com: domain of linux-kernel+bounces-15825-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15825-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id bk12-20020a05620a1a0c00b0077dcf0e1604si27202124qkb.717.2024.01.03.09.54.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:54:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15825-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=L1kvXiEP; spf=pass (google.com: domain of linux-kernel+bounces-15825-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15825-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id EE50F1C23C93 for ; Wed, 3 Jan 2024 17:54:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 55B641C68A; Wed, 3 Jan 2024 17:54:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="L1kvXiEP" X-Original-To: linux-kernel@vger.kernel.org Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC0C31C2A3; Wed, 3 Jan 2024 17:54:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=g3Q6A/OSBTzpvsA+ZueyJpCCrUPX6Gs2jbB2LOMyGZU=; b=L1kvXiEP+N+GxELX905cIpeDO/ Fum/7I+llgkoF6au7+5q5lD7WYxqCxjWc3lxB10+2+oQTvnGvGRGQBspPKliCu3alSezpqXATdGrF YNWzJy1nz0yv7YC9tj9b7XKQvQ1YLphocwT/hY57otg/RVTsIBJj/yPZjBX6Kw5C2Z/V02yuxH3J/ HK2qNkSLlarydo7UesLCYKwkF4LkpIC/IeklCIgKUcoPzmQ2Ij4UI+78N9tgDkZ7m+wmbZOdzrR8e wcN7B/uKTt6BZEUjw/gUYYjw/e0T9HYFGVjZbirAHs8MdhZctVx+ozf7UOu67ciQg5sjpIBfoDnYb nJ7p6cvg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1rL5RH-00DG5A-Jb; Wed, 03 Jan 2024 17:53:59 +0000 Date: Wed, 3 Jan 2024 17:53:59 +0000 From: Matthew Wilcox To: Hillf Danton Cc: Genes Lists , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: Re: 6.6.8 stable: crash in folio_mark_dirty Message-ID: References: <8bb29431064fc1f70a42edef75a8788dd4a0eecc.camel@sapience.com> <20231231012846.2355-1-hdanton@sina.com> <20240101015504.2446-1-hdanton@sina.com> <20240101113316.2595-1-hdanton@sina.com> <20240103104907.2657-1-hdanton@sina.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240103104907.2657-1-hdanton@sina.com> On Wed, Jan 03, 2024 at 06:49:07PM +0800, Hillf Danton wrote: > On Mon, 1 Jan 2024 14:11:02 +0000 Matthew Wilcox > > > > From an mm point of view, what is implicit is that truncate calls > > unmap_mapping_folio -> unmap_mapping_range_tree -> > > unmap_mapping_range_vma -> zap_page_range_single -> unmap_single_vma -> > > unmap_page_range -> zap_p4d_range -> zap_pud_range -> zap_pmd_range -> > > zap_pte_range -> pte_offset_map_lock() > > > > So a truncate will take the page lock, then spin on the pte lock > > until the racing munmap() has finished (ok, this was an exit(), not > > a munmap(), but exit() does an implicit munmap()). > > > But ptl fails to explain the warning reported, while the sequence in > __block_commit_write() > > mark_buffer_dirty(); > folio_mark_uptodate(); > > hints the warning is bogus. The folio is locked when filesystems call __block_commit_write(). Nothing explains the reported warning, IMO. Other than data corruption, and I'm not sure that we've found the last data corrupter.