Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1374476pxu; Mon, 23 Nov 2020 20:49:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJyA0RxaufqNU6YJlKPos/GXU/ledhPI5vl3EhMm3ha6II3TEzYmaxJo7fGwNUno6S6TA2gu X-Received: by 2002:a17:906:c04d:: with SMTP id bm13mr2473525ejb.519.1606193361595; Mon, 23 Nov 2020 20:49:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606193361; cv=none; d=google.com; s=arc-20160816; b=KLUEiPkOc6M5v71+ePQc007aAAWot7bTIf9zDOh6dMuVzaFykUOODclMa5rZSjP1fB nSbZbrpVP1oLQ3UWQpY81c7qN/ncrkDP6S7o8UheNbVFdjkBrzZMRaexLPJvno8K38LC S5dVcmfp/uKF6csUR+1e+7dfhv3we+BwPvzoM+fagCvP6v16+fKyeheoHIv7QRMIZsh1 dhqluJRBWVZbQKhgjSPGOubENSGpYpqOghUkYe2xrKQg5XPwgN+2XFwAwnf2vbDMntmd 25VzcPOrUSvODx6UyBbQRXhbIZ+lmhIzTr1W0sABsGT5XfyxY2zCPGasSTHj4FZwl99/ SgoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=24cszGpR4ywO4s4bnLwJTzF6tXtNEZ3Sx4FvfUI5fRM=; b=XiaDU2MSWhiXe/gOBaW4QTi9I9Xzz50+jaAQX83PP1X0SzIHbd6wMGKa4eRdbJ5Jfg tz8m6a0AI3lbAF3EVwNVKAJoj27t2kYUrwfhns/6AYIq8GrrrVYporFtqZEilTGyrTHU nj88KuAjDh08zLPkqi21C/dRA4gMKxKL8Cur8rhe5NK7X7vjCFZJQCg50C9SUqzxcox5 HIOBikRG3kM57gIGKmZ7zjgFyjfW/6U1sxiCN2x2KKkZWCg4Jup9hPdySkKmOSvBWTbo MRgVZHvPTQRAJXHk4qnnqAw5heRl9DQqIlw5IeLRBrEpj/XhNsd7V1AIZBGjv247hqhp 4h5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="Qo/w8pRw"; 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 a15si8907247edr.228.2020.11.23.20.48.57; Mon, 23 Nov 2020 20:49:21 -0800 (PST) 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; dkim=pass header.i=@linux-foundation.org header.s=google header.b="Qo/w8pRw"; 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 S1728883AbgKXEd0 (ORCPT + 99 others); Mon, 23 Nov 2020 23:33:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728828AbgKXEdZ (ORCPT ); Mon, 23 Nov 2020 23:33:25 -0500 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62211C0613CF for ; Mon, 23 Nov 2020 20:33:25 -0800 (PST) Received: by mail-lf1-x131.google.com with SMTP id d17so26952135lfq.10 for ; Mon, 23 Nov 2020 20:33:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=24cszGpR4ywO4s4bnLwJTzF6tXtNEZ3Sx4FvfUI5fRM=; b=Qo/w8pRweB3KyHg3F/WpjXkumwlz+D/AvIsfhGajTbc5rxWuFX6axMRr2JB4kSL4pA hIBC4OqrP3RwB25oHrD6ZaKBqVFGtNoYL6Y4nSMoCfYeCeQOINqE3jTOyTbnWeWoHLiI UkFQ9R+vhIKbEe6WKzj2zXtFUjc557jUOVygU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=24cszGpR4ywO4s4bnLwJTzF6tXtNEZ3Sx4FvfUI5fRM=; b=UIAKno/IV4Znas/RKYdyl1GwbqQgYWHn1bwOLKD0hbijdwkHkPd0RNhaV5QxlybVZw mxUt+AGKp69vK3+HiGHePLBMRUPuK5D8VzmdJWaR9dcyks6tzFuqKU9GGgw4nsQvxw3L rV8mVj6Fon/8j2V9Q1io7DAoPNtRRypjrsmsqNpYPThbOX3+KkZllKnsp2rJDoXCyopH DF63MZgFvq8Ab+nRgAIix+Y76dGwAqJvHq2nqBnkB7GRfPxnrHuYCZE08+2mRClqEVo+ m/NMnaGy7ZiKqaQHVA5GeNu1DhKPLDBCIEkGXAhziG5+5Y984TYv/wAURWUw6lUIz1Du 9MGg== X-Gm-Message-State: AOAM532kucA9F29zQplJgBLSTRaq0iEPUTG1dqcy2UnOkvQLCwX3zcQh aaBwljhnIvItZ0+UpdvQpMIyka+Ng2nRsA== X-Received: by 2002:a19:ccd5:: with SMTP id c204mr1005477lfg.469.1606192403619; Mon, 23 Nov 2020 20:33:23 -0800 (PST) Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com. [209.85.208.180]) by smtp.gmail.com with ESMTPSA id f27sm547074lfq.188.2020.11.23.20.33.23 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 Nov 2020 20:33:23 -0800 (PST) Received: by mail-lj1-f180.google.com with SMTP id r18so5731725ljc.2 for ; Mon, 23 Nov 2020 20:33:23 -0800 (PST) X-Received: by 2002:a19:3f55:: with SMTP id m82mr1019862lfa.344.1606192024162; Mon, 23 Nov 2020 20:27:04 -0800 (PST) MIME-Version: 1.0 References: <000000000000d3a33205add2f7b2@google.com> <20200828100755.GG7072@quack2.suse.cz> <20200831100340.GA26519@quack2.suse.cz> In-Reply-To: From: Linus Torvalds Date: Mon, 23 Nov 2020 20:26:48 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: kernel BUG at fs/ext4/inode.c:LINE! To: Hugh Dickins Cc: Jan Kara , syzbot , Andreas Dilger , Ext4 Developers List , Linux Kernel Mailing List , syzkaller-bugs , "Theodore Ts'o" , Linux-MM , Oleg Nesterov , Andrew Morton , "Kirill A. Shutemov" , Nicholas Piggin , Alex Shi , Qian Cai , Christoph Hellwig , "Darrick J. Wong" , Matthew Wilcox , William Kucharski , Jens Axboe , linux-fsdevel , linux-xfs Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Mon, Nov 23, 2020 at 8:07 PM Hugh Dickins wrote: > > The problem is that PageWriteback is not accompanied by a page reference > (as the NOTE at the end of test_clear_page_writeback() acknowledges): as > soon as TestClearPageWriteback has been done, that page could be removed > from page cache, freed, and reused for something else by the time that > wake_up_page() is reached. Ugh. Would it be possible to instead just make PageWriteback take the ref? I don't hate your patch per se, but looking at that long explanation, and looking at the gyrations end_page_writeback() does, I go "why don't we do that?" IOW, why couldn't we just make the __test_set_page_writeback() increment the page count if the writeback flag wasn't already set, and then make the end_page_writeback() do a put_page() after it all? Linus