Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp791402rdg; Thu, 10 Aug 2023 22:37:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFqHUBRxWm6PXuycInNsupoh4b91d11oc8fBi7YnueEEah7h19nyqBoC2IJFbwSWmJD6W6A X-Received: by 2002:a17:90a:ba93:b0:268:b64b:f684 with SMTP id t19-20020a17090aba9300b00268b64bf684mr601896pjr.33.1691732229965; Thu, 10 Aug 2023 22:37:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691732229; cv=none; d=google.com; s=arc-20160816; b=Cwvido5aKxgAs/aen9ieG6FK4W0mkQmtoDM9Z7/xLAJzZBUKm6GsZrjBNLEOaj6pOG Xj9A1onzPkIHlZm3VjEB3kam1uy0FZuPA481R8ojOMuq+378sni/6irzL5B392cqtKLy Z+AaxdADeQoqJGg87BFDGgGsmBl9w62nKzyRiwpfW7ICJmCTeCdEIZZKdd1JTxwO7dnm LED9TgkX+bYGTLMBfgTW/zvJS3S+zYijyOPI0yAEZbZy7jNQGkmJEZwQr6TAbIsljkgV DT5jiiucWnKS4EDkZCIJY0roBU1fW+cuYttd/Jt+/Qv1oDW+IaZ2OztulQ5LQe1rI3xL Pbog== 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:dkim-signature:date; bh=d39PtX8SWS7h1N0/fxVUJ2+xJ78W8r12Vyn4jEVrWxg=; fh=pNoK5RhQxWdniEyF7xIVZNd9szMg/GuOryH6+bnlrvY=; b=Kdud6dg6RGeDo9WqOhDI8F9mFKIugNNqP0oaWnhX45dWvzi3RrpY9UkxLz02cuFM2J r13D0CdO4Op/ioZ5r71grW1zMPrc0GdNaKJLURkv3zM6xD+WFqWQu5kcn2W1/Mkq1fhY 2epFZBZjYT4JVzf9JyUyWhqsMwgXu3NkC/9Fjb/zJ5HR9Ku7TmYrE00Wd3m5EygD0++l ZSdzv1LpPR+k/kKcIYpPEHMEA+zPWk+7j7xiOiga8gfmxhnennjUOHTE51zthOZ0SkcY sCtD2UdRik05eNtLlN9TF2Je9v7yZQ1/xOpuL4PNf+/0+JpikZORBJdQ0U/dSfHqvRIG xv8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="bAJi/cyi"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e11-20020a17090a4a0b00b0025bdfe1bc66si4777308pjh.165.2023.08.10.22.36.57; Thu, 10 Aug 2023 22:37:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="bAJi/cyi"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231948AbjHKEDU (ORCPT + 99 others); Fri, 11 Aug 2023 00:03:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbjHKEDT (ORCPT ); Fri, 11 Aug 2023 00:03:19 -0400 Received: from out-116.mta1.migadu.com (out-116.mta1.migadu.com [IPv6:2001:41d0:203:375::74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E34599B for ; Thu, 10 Aug 2023 21:03:17 -0700 (PDT) Date: Fri, 11 Aug 2023 00:03:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1691726596; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=d39PtX8SWS7h1N0/fxVUJ2+xJ78W8r12Vyn4jEVrWxg=; b=bAJi/cyiHJjK6oL6Lz2twYj69M1Lo19Lp9v5Uagasmwl9MYbCuhpkHKWyH22sTbItSsTLB MuyPgk1VKMdLi+su96w6+qDClpwMX2+GfwI+kHOV0sHxeFTD+6nHboRF+6tiSe3w4W1TdG MFDBjzrIJaz90eQCMLkFO2/wUmGzmWM= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Linus Torvalds Cc: "Darrick J. Wong" , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-bcachefs@vger.kernel.org, dchinner@redhat.com, sandeen@redhat.com, willy@infradead.org, josef@toxicpanda.com, tytso@mit.edu, bfoster@redhat.com, jack@suse.cz, andreas.gruenbacher@gmail.com, brauner@kernel.org, peterz@infradead.org, akpm@linux-foundation.org, dhowells@redhat.com, snitzer@kernel.org, axboe@kernel.dk Subject: Re: [GIT PULL] bcachefs Message-ID: <20230811040310.c3q6nml6ukwtw3j5@moria.home.lan> References: <20230626214656.hcp4puionmtoloat@moria.home.lan> <20230706155602.mnhsylo3pnief2of@moria.home.lan> <20230712025459.dbzcjtkb4zem4pdn@moria.home.lan> <20230810155453.6xz2k7f632jypqyz@moria.home.lan> <20230810223942.GG11336@frogsfrogsfrogs> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 10, 2023 at 04:47:22PM -0700, Linus Torvalds wrote: > So I might be barking up entirely the wrong tree. Yeah, I think you are, it sounds like you're describing an entirely different sort of race. The issue here is just that killing off a process should release all the references it holds, and if we kill off all processes accessing a filesystem we should be able to unmount it - but in this case we can't, because fputs() are being delayed asynchronously. delayed_fput() from AIO turned out to not be an issue in my testing, for reasons that are unclear to me; flush_delayed_fput() certainly isn't called in any relevant codepaths. The code _looks_ buggy to me, but I wasn't able to trigger the bug with AIO. io_uring adds its own layer of indirect asynchronous reference holding, and that's why the issue crops up there - but io_uring isn't using delayed_fput() either. The patch I posted was to make sure the file ref doesn't outlive the task - I honestly don't know what you and Jens don't like about that approach (obviously, adding task->ref gets and puts to fastpaths is a nonstarter, but that's fixable as mentioned).