Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp19602841rwd; Wed, 28 Jun 2023 11:25:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ41xWms1aHxwJWnbzRSZQv9sxQRPgbemowDLfCTg295ZA6TSHHRQJqxwQ/De9oc1sEvhk5g X-Received: by 2002:a17:906:7943:b0:988:7d1:f5a5 with SMTP id l3-20020a170906794300b0098807d1f5a5mr25780722ejo.28.1687976730374; Wed, 28 Jun 2023 11:25:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687976730; cv=none; d=google.com; s=arc-20160816; b=IK3qb9WaEmV/sNnlAPWslC4b+OxRN+v/Zv5FS0YASwLNRQs3EOkgPoMFjuRMcMQcyi eYJBDfJxxBb5tDvWpCOYCOw8rwWdnQ0UA/lqWWmib5089AJ6ZUBSpc53Rh9cujexiir9 jQyaajOpVgnw2TYuze+kkSFcqazDC0kzFYkcuwUzywro6wYBfSPSprM2HCce0yLWCWue vZdkwkn/jdddX42pTGJqDhVUGmTSZbCztk7O32wf+y5L1av5+f8c5TzZKMX3xh2Yezd5 tH6Quwob/yUKbUWzFXNtm/AuASg4giObBb3YQ7Hrte3C8gv25eATKk4F3No73unfem36 DpbA== 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=3wb1kX6L9/pLjHJdQokUyimNTJMnyAUv+LwDyu/SD5A=; fh=bnR/zj5jkQlGPhBYagutZtQaNCSKIioy0vjOcMI9c/k=; b=wRwo0SAE08bKKhNdffwUbaI31ToNxp/fyxU0Mxru+0VBT+dTqS8SGt6nbfMmlwXlYZ dMotZYRHrYgrXodIlVkncMast0+ybJGZWGz0ondUlw8yhE18Sc8g1dIpHZwIO9hPK2L5 UmX57S0zNFYYHvILDr8u/Rli5G/r7hbmCmzegaHQTz0X4UShcGI3h+SkUFv+x+GCnUMB 9+JPXfYDVLQGxIctwnUMGTxQzK5EST3+35LvWSqop8/hDip/PMlJm5ldNxq1NFDd9ilf v8mZucEVNRhsqOv0cZct4o1Tcwk5H+4LFxhiTN/DfacBRPBi9lhObzaZsfFv0VZGdN01 eZYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=NF2SPqay; 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 bx14-20020a170906a1ce00b009891f47b282si5817052ejb.1012.2023.06.28.11.24.42; Wed, 28 Jun 2023 11:25:30 -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=NF2SPqay; 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 S231733AbjF1RwU (ORCPT + 99 others); Wed, 28 Jun 2023 13:52:20 -0400 Received: from out-15.mta0.migadu.com ([91.218.175.15]:56295 "EHLO out-15.mta0.migadu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231750AbjF1RwL (ORCPT ); Wed, 28 Jun 2023 13:52:11 -0400 Date: Wed, 28 Jun 2023 13:52:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1687974729; 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=3wb1kX6L9/pLjHJdQokUyimNTJMnyAUv+LwDyu/SD5A=; b=NF2SPqayC4BiclJHcHAIBaBByf4KV5Q43ZH0e95617IhssmKgWnWUFtxGyotr/gKZhsNm1 RN+KQcxyvA5BGAeqHSlWP2WprMri89bMWLGDEt7y92eH+lt1bEABpnImsptiWCu8Qw+EWG RijQZcqgyot80L03bXHj53Ze3srap7k= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Jens Axboe Cc: torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-bcachefs@vger.kernel.org, Christoph Hellwig , Christian Brauner Subject: Re: [GIT PULL] bcachefs Message-ID: <20230628175204.oeek4nnqx7ltlqmg@moria.home.lan> References: <20230627000635.43azxbkd2uf3tu6b@moria.home.lan> <91e9064b-84e3-1712-0395-b017c7c4a964@kernel.dk> <20230627020525.2vqnt2pxhtgiddyv@moria.home.lan> <23922545-917a-06bd-ec92-ff6aa66118e2@kernel.dk> <20230627201524.ool73bps2lre2tsz@moria.home.lan> <20230628040114.oz46icbsjpa4egpp@moria.home.lan> <4b863e62-4406-53e4-f96a-f4d1daf098ab@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4b863e62-4406-53e4-f96a-f4d1daf098ab@kernel.dk> X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 28, 2023 at 10:57:02AM -0600, Jens Axboe wrote: > I discussed this with Christian offline. I have a patch that is pretty > simple, but it does mean that you'd wait for delayed fput flush off > umount. Which seems kind of iffy. > > I think we need to back up a bit and consider if the kill && umount > really is sane. If you kill a task that has open files, then any fput > from that task will end up being delayed. This means that the umount may > very well fail. > > It'd be handy if we could have umount wait for that to finish, but I'm > not at all confident this is a sane solution for all cases. And as > discussed, we have no way to even identify which files we'd need to > flush out of the delayed list. > > Maybe the test case just needs fixing? Christian suggested lazy/detach > umount and wait for sb release. There's an fsnotify hook for that, > fsnotify_sb_delete(). Obviously this is a bit more involved, but seems > to me that this would be the way to make it more reliable when killing > of tasks with open files are involved. No, this is a real breakage. Any time we introduce unexpected asynchrony there's the potential for breakage: case in point, there was a filesystem that made rm asynchronous, then there were scripts out there that deleted until df showed under some threshold.. whoops... this would break anyone that does fuser; umount; and making the umount lazy just moves the race to the next thing that uses the block device. I'd like to know how delayed_fput() avoids this.