Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2862080rwr; Sat, 6 May 2023 22:43:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Aoz3Ve6CG99NOH9u5tGPFa6hQwx/7zAQYHt5BC3Wsu/EWTm4qicm9gXNfxhi9Fw3JNbE7 X-Received: by 2002:a05:6a20:4326:b0:100:b1b:2e6c with SMTP id h38-20020a056a20432600b001000b1b2e6cmr1499617pzk.52.1683438211428; Sat, 06 May 2023 22:43:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683438211; cv=none; d=google.com; s=arc-20160816; b=Yl2gJzyR1ofPlQ4A8sEBY6vmoUZUm20q0HUkG6vF0gTs0SCZ8GkB5BM72sRHzsGNaG SDkGqVTy6kGiNfZni3/EtDmQPsqlFdJH4FNRPl4X08vcnv7sgQ2RGEEdy7x/5OQKvNpd 5GsSbszTRPFsEatAfLKCEIDo1PlhBluAg0PooFz0NrZhxIRGv/73jF3cN4Rr+GY6qhu7 8xOGF1PM1x9C9Hy+W9sA1y99Um74ThWOOhBdWI92UmHodwAxtCGvVXP9iQ9lSsD6Yt7r 8+TQpWUC4AYJid+hmQ19x8t8h8Qd2gG3p48gbxfyAjQZzhS6/HmBAQzN5/xKDbny3ky7 4jhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=b16pvkFJ4Cj1AZWCp8PgHr2DhPedtl50McgM9oFwRH4=; b=BxSHpufb58fHlDkNkg7MV6/SHLVbDLzItC6jkefTt/ZCVIAHUEwx3a/L9r1J2EcOuF nqVARiXvbvbX6/1H93bUCEKgTIXPRpN2r0+FQ0jOmZvoNTVXnjqDmw4Hkr2zhNT2d5s6 f73etngulU2KO2H8P4d+2GpwsRjQCj4mOZbGA3MoySCWKPzkdmrFSkWSf5lsAZ7R5FmC Po1JIfV4hcZeo908Amh6Gs2ImDdtHTFwpMipVmOnanFF/WzJGjPUPPOmMrwASKsFug9+ 3qsFf6XIYJLErU45xrCeZAix4Y4rye2KHWbx1HPklYLn3q13ZUK/JaLl5cbUfahe7Tee piKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=uwHwySSr; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n127-20020a632785000000b0050971cbf2dbsi6237964pgn.226.2023.05.06.22.43.18; Sat, 06 May 2023 22:43:31 -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=@infradead.org header.s=bombadil.20210309 header.b=uwHwySSr; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230144AbjEGEIn (ORCPT + 99 others); Sun, 7 May 2023 00:08:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230039AbjEGEIl (ORCPT ); Sun, 7 May 2023 00:08:41 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 046FA6E93; Sat, 6 May 2023 21:08:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=b16pvkFJ4Cj1AZWCp8PgHr2DhPedtl50McgM9oFwRH4=; b=uwHwySSrHB8dIxJ03/rCIDCwyx oLkh/0RR9rtkJna17tGDdBVXM22zwSZFMFPNZ2LHbQzQgGbBfo4ppYyo+hkevFvIlCjfraQGJUAHK G2NC0m9v/CmBeFYxb7iJ+R6lfH4woO7jXWpGSSYPyf9LLtBezHS8EmdIsP/4bPZc6kzS5+fnUX1UJ Srj/y92UwWy5zKsbzaYBLp0fRryQFf4weSx9MqyqzwccW6sMwectvN0lObCogsJCJgLLECtFbhXl4 L8xAWwTW2uRZteJJ1vPi6uGPcFRbCQbIBQrIJMTvfNHUEY7wTPc1mw02g4xQ4CzhRxmVj3MPH1AQ1 jKXnjhkA==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1pvVhL-00F7Zt-0g; Sun, 07 May 2023 04:08:35 +0000 Date: Sat, 6 May 2023 21:08:35 -0700 From: Luis Chamberlain To: Jan Kara Cc: "Darrick J. Wong" , hch@infradead.org, song@kernel.org, rafael@kernel.org, gregkh@linuxfoundation.org, viro@zeniv.linux.org.uk, bvanassche@acm.org, ebiederm@xmission.com, mchehab@kernel.org, keescook@chromium.org, p.raghav@samsung.com, linux-fsdevel@vger.kernel.org, kernel@tuxforce.de, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, xfs Subject: Re: [RFC v3 03/24] fs: distinguish between user initiated freeze and kernel initiated freeze Message-ID: References: <20230114003409.1168311-1-mcgrof@kernel.org> <20230114003409.1168311-4-mcgrof@kernel.org> <20230118092812.2gl3cde6mocbngli@quack3> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230118092812.2gl3cde6mocbngli@quack3> Sender: Luis Chamberlain X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, 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 Wed, Jan 18, 2023 at 10:28:12AM +0100, Jan Kara wrote: > On Tue 17-01-23 18:25:40, Darrick J. Wong wrote: > > [add linux-xfs to cc on this one] > > > > On Fri, Jan 13, 2023 at 04:33:48PM -0800, Luis Chamberlain wrote: > > > Userspace can initiate a freeze call using ioctls. If the kernel decides > > > to freeze a filesystem later it must be able to distinguish if userspace > > > had initiated the freeze, so that it does not unfreeze it later > > > automatically on resume. > > > > Hm. Zooming out a bit here, I want to think about how kernel freezes > > should behave... > > > > > Likewise if the kernel is initiating a freeze on its own it should *not* > > > fail to freeze a filesystem if a user had already frozen it on our behalf. > > > > ...because kernel freezes can absorb an existing userspace freeze. Does > > that mean that userspace should be prevented from undoing a kernel > > freeze? Even in that absorption case? > > > > Also, should we permit multiple kernel freezes of the same fs at the > > same time? And if we do allow that, would they nest like freeze used to > > do? > > > > (My suggestions here are 'yes', 'yes', and '**** no'.) > > Yeah, makes sense to me. So I think the mental model to make things safe > is that there are two flags - frozen_by_user, frozen_by_kernel - and the > superblock is kept frozen as long as either of these is set. Makes sense to me. Luis