From patchwork Thu Jun 6 09:20:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roxana Nicolescu X-Patchwork-Id: 1944520 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VvzMr48psz20PW for ; Thu, 6 Jun 2024 19:20:55 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1sF9IU-0005fl-2z; Thu, 06 Jun 2024 09:20:38 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1sF9IS-0005fA-7g for kernel-team@lists.ubuntu.com; Thu, 06 Jun 2024 09:20:36 +0000 Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 0C17D3F13F for ; Thu, 6 Jun 2024 09:20:36 +0000 (UTC) Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a68e0faf1f6so30414666b.3 for ; Thu, 06 Jun 2024 02:20:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717665635; x=1718270435; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7vwSJ62P84k2TfUqgF16xa3n5UDSXzWewkqjyfq41Cs=; b=Rz1l8k5/ZBfHHGTcogehYqWFAMzWOpDAKm9Hf+b6I+ZywrmdK3xE69GVGfvzYNif8F n6u46EOV8Jc64STigqj8C2/xIbLEYelWzyUoiikhqsZnZJeJv7jQX66Kd6ZB9IfU/2vU QHc0wNI/L/FxwH6VqAvF3nxUnWoVKzTzX1qusYBRIe8PX2p3gnl+p2V0JpEO7wrAmMyb RHjIFAYI4Qu2ZGmK6LqHyitELhbXwLHCwza0pKJa57PU/vIuvbmOTYW0jNTRNafpaJ+F KP/P4GwyJGgLJLR0W/CGMx/zqs3ehyqchewstnZeJ7Ko1Z5EV4gAH7KrQbwj/JlfGl3+ Mvtw== X-Gm-Message-State: AOJu0YwrcpKDrSz6suA4p8mYWVpLDdYAN706QZovI2lYpR+OktP1Nui+ qovsoEBTtETIcGVxSHICWCpKHNNA2IZIVyFq1AyEwGp59v+KebEzz28fNk/MLVzjT1LiPmKSYnW TgDoP2CYf+c3XJVHfn8iXp/T+0EnthKZu2n8Ek1KsrgX+vVCKYlKiIz0dy5SdKZllxaBPM1uTqh B2sDrtQ7ReTteZ X-Received: by 2002:a17:906:594e:b0:a69:2011:7119 with SMTP id a640c23a62f3a-a699fac5565mr275427966b.41.1717665635681; Thu, 06 Jun 2024 02:20:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHxhzNwODSoZOSKhIkYDtWrlr9eQ973PUDi+RT2KbBn0agW9xuIm7R+tmS5KIXZ0rANaRNnyA== X-Received: by 2002:a17:906:594e:b0:a69:2011:7119 with SMTP id a640c23a62f3a-a699fac5565mr275426466b.41.1717665635231; Thu, 06 Jun 2024 02:20:35 -0700 (PDT) Received: from work.lan (77-169-125-32.fixed.kpn.net. [77.169.125.32]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6c8072ad40sm68405966b.218.2024.06.06.02.20.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 02:20:35 -0700 (PDT) From: Roxana Nicolescu To: kernel-team@lists.ubuntu.com Subject: [SRU][N][PATCH] btrfs: re-introduce 'norecovery' mount option Date: Thu, 6 Jun 2024 11:20:34 +0200 Message-Id: <20240606092034.16613-1-roxana.nicolescu@canonical.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Qu Wenruo BugLink: https://bugs.launchpad.net/bugs/2068591 Although 'norecovery' mount option was marked as deprecated for a long time and a warning message was printed during the deprecation window, it's still actively utilized by several projects that need a safer way to mount a btrfs without any writes. Furthermore this 'norecovery' mount option is supported by other major filesystems, which makes it less clear what's our motivation to remove it. Re-introduce the 'norecovery' mount option, and output a message to recommend 'rescue=nologreplay' option. Link: https://lore.kernel.org/linux-btrfs/ZkxZT0J-z0GYvfy8@gardel-login/#t Link: https://github.com/systemd/systemd/pull/32892 Link: https://bugzilla.suse.com/show_bug.cgi?id=1222429 Reported-by: Lennart Poettering Reported-by: Jiri Slaby Fixes: a1912f712188 ("btrfs: remove code for inode_cache and recovery mount options") CC: stable@vger.kernel.org # 6.8+ Reviewed-by: Johannes Thumshirn Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba (cherry picked from commit 440861b1a03c72cc7be4a307e178dcaa6894479b) Signed-off-by: Roxana Nicolescu Acked-by: Stefan Bader Acked-by: Paolo Pisati --- fs/btrfs/super.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index c45fdaf24cd1..8f171616159e 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -121,6 +121,7 @@ enum { Opt_thread_pool, Opt_treelog, Opt_user_subvol_rm_allowed, + Opt_norecovery, /* Rescue options */ Opt_rescue, @@ -247,6 +248,8 @@ static const struct fs_parameter_spec btrfs_fs_parameters[] = { __fsparam(NULL, "nologreplay", Opt_nologreplay, fs_param_deprecated, NULL), /* Deprecated, with alias rescue=usebackuproot */ __fsparam(NULL, "usebackuproot", Opt_usebackuproot, fs_param_deprecated, NULL), + /* For compatibility only, alias for "rescue=nologreplay". */ + fsparam_flag("norecovery", Opt_norecovery), /* Debugging options. */ fsparam_flag_no("enospc_debug", Opt_enospc_debug), @@ -440,6 +443,11 @@ static int btrfs_parse_param(struct fs_context *fc, struct fs_parameter *param) "'nologreplay' is deprecated, use 'rescue=nologreplay' instead"); btrfs_set_opt(ctx->mount_opt, NOLOGREPLAY); break; + case Opt_norecovery: + btrfs_info(NULL, +"'norecovery' is for compatibility only, recommended to use 'rescue=nologreplay'"); + btrfs_set_opt(ctx->mount_opt, NOLOGREPLAY); + break; case Opt_flushoncommit: if (result.negated) btrfs_clear_opt(ctx->mount_opt, FLUSHONCOMMIT);