From patchwork Mon Mar 3 17:12:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 13999298 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2FE17C282D2 for ; Mon, 3 Mar 2025 17:21:50 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tp9UD-0004Et-6a; Mon, 03 Mar 2025 17:21:49 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tp9UB-0004En-Po for linux-f2fs-devel@lists.sourceforge.net; Mon, 03 Mar 2025 17:21:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=content-type:Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ms474Fkjaj3ya8iT1IToTwuVBOxP1ecoS432F/DQxlI=; b=ItPBYfMzYJF63aThuwXAHHoVzR /MTh2LuWiDSaVPbWkXjgyWex7ge3iNVVtW7ABr2xF1p3aqSjtAIH6pE/gw/v14J/o3TTWet91V+zV VRZnSGGSSM587Vez57SnidWo11l8gBoV5xBx1v9DtIDOtzruIqw1rsJ/m4dAJRtIjVd8=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=content-type:Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=ms474Fkjaj3ya8iT1IToTwuVBOxP1ecoS432F/DQxlI=; b=Na2Cl5pacsUdye5CcEefqR+ZHJ 0VkQNu6PV1vpH+3eNOZVgY/5+aKCUSLNj4Ldsi/QlzMVwkUJAMaz/cWcDrNs4BQpqFyWVNQ8Jt8zG bhH+8Hbz69y3RzQctMTwx0JPx34/V1YNzoCGXDszNWahBWpIGJf3E0f0TchrkxQnFzD4=; Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1tp9UB-0008QN-2h for linux-f2fs-devel@lists.sourceforge.net; Mon, 03 Mar 2025 17:21:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741022501; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ms474Fkjaj3ya8iT1IToTwuVBOxP1ecoS432F/DQxlI=; b=JfEh59ji6pHCsiC+kNaRg/mJJXFPn6YCJxDdZ9njgOUntHN4WJIIpBwOhvqlRWxcKyoAaa vlwhI+1kUv1rFyoyewXYFa7GRJ/eq2HRD6MoMo0nDl+1QbgJuNuZ4GT3kgCR++9NiFBpLF +ost25dyK0pIaGAsd/BMiNAblNdtg+M= Received: from mail-io1-f72.google.com (mail-io1-f72.google.com [209.85.166.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-450-_5BWCWJSOumy5C1zQ9wkoA-1; Mon, 03 Mar 2025 12:21:35 -0500 X-MC-Unique: _5BWCWJSOumy5C1zQ9wkoA-1 X-Mimecast-MFC-AGG-ID: _5BWCWJSOumy5C1zQ9wkoA_1741022494 Received: by mail-io1-f72.google.com with SMTP id ca18e2360f4ac-85ad875acccso315988639f.3 for ; Mon, 03 Mar 2025 09:21:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741022494; x=1741627294; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ms474Fkjaj3ya8iT1IToTwuVBOxP1ecoS432F/DQxlI=; b=dhSgAExZ8wjhrhEGytkhvdxLYlhbe4L3g/OPUYWlIY9i29fcXQC0//hDsMCromtibv zQbS+5Wqt263EqbX4IW0grZi/5zs+ZfjX50rGU+YL4h/nJwCpca7/wFglt18ttgoEqwT 4EgIWYpOyO/huh61KF1PxdEsG+C2UT9yqfjHxiX/pMR7YegM1NafvDJPznmsJcjexHB+ i2Vh1pHnTPOvsc0eFHG2lDFctCqQ+X6WIV+sBuACwAgZ5wJNoO9MGb7vn8NLnnqKWaH5 U9Hi2mU+F7JvTD8MUb8+FKQH4vW1iKzyONuVc8T3LvjTl54de1IlXbX2ihq5ArjxGfKy gyXA== X-Gm-Message-State: AOJu0Yyfrmb1Tv3gemRMNa/aYR7mSGXgFSRDul2dmhu1K/c5q/3du2Pj FyLy4QXxfkQEkwzjcABA/3Fa847dnYvXSchJ6gm47aCQm9Xq3oLYWX/TVBE5PJZdO1ZlH12C+pN ZliGMSQbbMGy+HAl8J43AkXEz6Two6fAxWM6smGOt1rtLwlibzW5KpNeMjFpigGIdoxKBqiy7pe WIUZ3T1j08LTaq6+yLVC9yrgKApWxLVV10E4p5AdTfqJyoKZW7Mhh47vGfbA== X-Gm-Gg: ASbGnctjwPjpXwIubG2y9fl1TpQrYW1In3hy8TlzAy7FGQD8D16PEfz9ghEQyMMYzOA u27KBUZCJFwaRz2kvuiVMYXXAzsi0idWSN5VR8UP4h51Ho7ANnfipqGlxAtz91E6ZwFohxDfjTg rUA0C4Dr55/oeK+v5lFOkfFI3a5P7uw8einN1J49aur/NviQtb4yfmbtgWjxJgC0sLeQxkM/9PB UZ52zthCQd8sa1FjIPh1v83MLhrgrMHEU8+Avpz7WeyjTQFzJnbMzpeRQCSh40BakAgxVt3ANRt 0td0krsdHv2crGb9R7RrZrG86aQOHYk= X-Received: by 2002:a05:6602:640f:b0:855:63c8:abb5 with SMTP id ca18e2360f4ac-85881fdba3amr1465803439f.13.1741022492868; Mon, 03 Mar 2025 09:21:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IHLg+dPHtzUuhlIl5+NdRK5VlJhpA45XNfYazemqa+5sRK2tzbtwcjAYy0M5Q1rfQqIa1bqBw== X-Received: by 2002:a05:6602:640f:b0:855:63c8:abb5 with SMTP id ca18e2360f4ac-85881fdba3amr1465788739f.13.1741022491032; Mon, 03 Mar 2025 09:21:31 -0800 (PST) Received: from fedora-rawhide.sandeen.net ([65.128.97.82]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-85add261b4csm49563939f.9.2025.03.03.09.21.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Mar 2025 09:21:30 -0800 (PST) From: Eric Sandeen To: linux-f2fs-devel@lists.sourceforge.net Date: Mon, 3 Mar 2025 11:12:11 -0600 Message-ID: <20250303172127.298602-2-sandeen@redhat.com> X-Mailer: git-send-email 2.48.0 In-Reply-To: <20250303172127.298602-1-sandeen@redhat.com> References: <20250303172127.298602-1-sandeen@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: MnvutL_9SWvyTGD9W_e095lHf-nnCuQ_s70AuiLIyuA_1741022494 X-Mimecast-Originator: redhat.com X-Headers-End: 1tp9UB-0008QN-2h Subject: [f2fs-dev] [PATCH 1/9] f2fs: use f2fs_sb_has_device_alias during option parsing X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jaegeuk@kernel.org, lihongbo22@huawei.com, Eric Sandeen Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Rather than using F2FS_HAS_FEATURE directly, use f2fs_sb_has_device_alias macro during option parsing for consistency. Signed-off-by: Eric Sandeen Reviewed-by: Chao Yu --- fs/f2fs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 19b67828ae32..dd35d199775a 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -838,7 +838,7 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount) set_opt(sbi, READ_EXTENT_CACHE); break; case Opt_noextent_cache: - if (F2FS_HAS_FEATURE(sbi, F2FS_FEATURE_DEVICE_ALIAS)) { + if (f2fs_sb_has_device_alias(sbi)) { f2fs_err(sbi, "device aliasing requires extent cache"); return -EINVAL; } From patchwork Mon Mar 3 17:12:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 13999304 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E2649C282D2 for ; Mon, 3 Mar 2025 17:22:02 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tp9UQ-0004Fr-In; Mon, 03 Mar 2025 17:22:02 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tp9UP-0004Fk-TX for linux-f2fs-devel@lists.sourceforge.net; Mon, 03 Mar 2025 17:22:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=content-type:Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=HNtb0WzQQqVfRRT8LeO2w0dai1vRf4isndM0H68L+7U=; b=k0XLmCkwsEkl1zGjoz9xF6e5c/ lv12LY6USwfQa3INDFkCot4H5UPZf9I+36ggQPBuHFGN+G3Q3UUDxybg+iFBk5E/7oAsn5EsSLegD JXKAxiVtEqUWwRFIgQbf/aGUfcniIrIJ7rl7vJK3mFvsnc8DhH8a0DF+ea1Do7r7R37g=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=content-type:Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=HNtb0WzQQqVfRRT8LeO2w0dai1vRf4isndM0H68L+7U=; b=c/ISzsl7XXD+wi6LCs72S+ch1m eLwf4ou1FI/hSoowAH7k4As1lpRVZrF6IVCy3bWMjXHz3AYX57uPwp2QLkVrxTe1BO2uyqETw9qzu 75BTmr5tQoPHEpPRGMXN7y49ouCTSRcNk6TydXWrCXeffqY1jwy/HcHuch82xiISpdJQ=; Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1tp9UF-0008QW-5K for linux-f2fs-devel@lists.sourceforge.net; Mon, 03 Mar 2025 17:22:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741022500; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HNtb0WzQQqVfRRT8LeO2w0dai1vRf4isndM0H68L+7U=; b=XbFDBwl3d/31NZ8gIwEsQecXu+x8eMoTVmyrbfR9ZiHH8WB4JywANaOmppWoChvEBVPjJZ PMplJbcKqet9VVT1suLEpMNz71mtX+TNuiKuLlG/JqdfcaSxUo/dw9cHEzHBvUrNqfjLbV 4zdu8r8efQRse0Y2ixbZIXWMRCqoxvM= Received: from mail-io1-f70.google.com (mail-io1-f70.google.com [209.85.166.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-595-76itFTxqN9CnjR-wqn68uA-1; Mon, 03 Mar 2025 12:21:33 -0500 X-MC-Unique: 76itFTxqN9CnjR-wqn68uA-1 X-Mimecast-MFC-AGG-ID: 76itFTxqN9CnjR-wqn68uA_1741022493 Received: by mail-io1-f70.google.com with SMTP id ca18e2360f4ac-85ae1c53d9fso61778439f.1 for ; Mon, 03 Mar 2025 09:21:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741022492; x=1741627292; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HNtb0WzQQqVfRRT8LeO2w0dai1vRf4isndM0H68L+7U=; b=sslQ1gnh+0Zp1jqYHwlNfpCPh9Exblrd3zkLgwPhLKy9apHJqSE/Dg1ecI1po3TKzX 6QxMTexpfn7dxrE5t7xsP8Sw5bsXLFnJFsI2rpo8+oNZMVBBz0fA+xyJduUokyNZfbvO ZMh/JYOtqwNx0r9UzizQZTvPUC+owwiB4Az4DYwpU4WkkO8C4sTIy0y3wyC3OoPZ0FJt HwVrEjpi6zr1k0usV8GdgqFtgGghpKClxKplgvyBBUwIaZwbdXp/9rj1sMd7rO6kuRqH ep0d2a8kxoUxWYyz65vwOZ1t/EpwHlIusv1OHbkIbZdxZfV7eDZk0Vz7JjgE3tnVvRN5 IdlA== X-Gm-Message-State: AOJu0YyBK5KDV6E34xPXh6czPulmW5blmxKJt0rTldCPS8Vd0pm1ziQt rMmSgk0LKdjpqg5tF1V4CLQ6s3R4vYZgJQ0syGjUfFpcKfY1dekInsXEK+LurALcLgyqWEtLjdp sUj3l8/Q4wzcyrRdsgYuduqvcjmNshCEIwV5+Env12WozxmKU13+f4f0EQ1hHowGocrwFTFcWc8 DIlsJY9332+DYfN5v87uol9LBx5hbX39E+dWfGogA2DE67MLddR18GQsIp0g== X-Gm-Gg: ASbGncvk5dyIF8Vqy0cJavapzrZQky64tqEIUCYhZCvZ1jVM/ZoGWyQG+uZgf3DrsA0 0pjjRxXO8sCcjH4Hx04i1EvN42Q8UDtNYU9xYjOeNxaVdSmkHOA5aqlNhBT5XkTmYGSHoYfxDoW 2UtR6VZ4lNI2IaRkzv7yFryBtgbS1S04a0y3biAgEUa0mp+ooqWoy8KqEEY0nz0wsCQsLpk58xl Ihf66Q3KbzpLH5zVblzvUC9TqfISWuqMX0R5VWp5efCWW4uk1MWO8mM5LEcRf5Qjq4uaP1yfSUF lNADJtTBp87YaPpRdqh7F/EYdsozxWE= X-Received: by 2002:a05:6602:3d2:b0:855:c476:8b97 with SMTP id ca18e2360f4ac-85881f33220mr1485014839f.8.1741022492455; Mon, 03 Mar 2025 09:21:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IGIqoYIsFI9g8LJvmlMWS9DAajpDgeNl7wWzqTZed7/KB7vi5InR7IRviL6Qny+wybYiL4zlQ== X-Received: by 2002:a05:6602:3d2:b0:855:c476:8b97 with SMTP id ca18e2360f4ac-85881f33220mr1485012239f.8.1741022492045; Mon, 03 Mar 2025 09:21:32 -0800 (PST) Received: from fedora-rawhide.sandeen.net ([65.128.97.82]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-85add261b4csm49563939f.9.2025.03.03.09.21.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Mar 2025 09:21:31 -0800 (PST) From: Eric Sandeen To: linux-f2fs-devel@lists.sourceforge.net Date: Mon, 3 Mar 2025 11:12:12 -0600 Message-ID: <20250303172127.298602-3-sandeen@redhat.com> X-Mailer: git-send-email 2.48.0 In-Reply-To: <20250303172127.298602-1-sandeen@redhat.com> References: <20250303172127.298602-1-sandeen@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: k2TI-EjBfrnmZUUacZqnND5cCqf7fUIJJXaoU4zjo8E_1741022493 X-Mimecast-Originator: redhat.com X-Headers-End: 1tp9UF-0008QW-5K Subject: [f2fs-dev] [PATCH 2/9] f2fs: consolidate unsupported option handling errors X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jaegeuk@kernel.org, lihongbo22@huawei.com, Eric Sandeen Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net When certain build-time options are disabled, some mount options are not accepted. For quota and compression, all related options are dismissed with a single error message. For xattr, acl, and fault injection, each option is handled individually. In addition, inline_xattr_size was missed when CONFIG_F2FS_FS_XATTR was disabled. Collapse xattr, acl, and fault injection errors into a single string, for simplicity, and handle the missing inline_xattr_size case. Signed-off-by: Eric Sandeen Reviewed-by: Chao Yu --- fs/f2fs/super.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index dd35d199775a..29b3aa1ee99c 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -772,16 +772,11 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount) break; #else case Opt_user_xattr: - f2fs_info(sbi, "user_xattr options not supported"); - break; case Opt_nouser_xattr: - f2fs_info(sbi, "nouser_xattr options not supported"); - break; case Opt_inline_xattr: - f2fs_info(sbi, "inline_xattr options not supported"); - break; case Opt_noinline_xattr: - f2fs_info(sbi, "noinline_xattr options not supported"); + case Opt_inline_xattr_size: + f2fs_info(sbi, "xattr options not supported"); break; #endif #ifdef CONFIG_F2FS_FS_POSIX_ACL @@ -793,10 +788,8 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount) break; #else case Opt_acl: - f2fs_info(sbi, "acl options not supported"); - break; case Opt_noacl: - f2fs_info(sbi, "noacl options not supported"); + f2fs_info(sbi, "acl options not supported"); break; #endif case Opt_active_logs: @@ -919,11 +912,8 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount) break; #else case Opt_fault_injection: - f2fs_info(sbi, "fault_injection options not supported"); - break; - case Opt_fault_type: - f2fs_info(sbi, "fault_type options not supported"); + f2fs_info(sbi, "fault injection options not supported"); break; #endif case Opt_lazytime: From patchwork Mon Mar 3 17:12:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 13999299 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7DCBDC282D1 for ; Mon, 3 Mar 2025 17:21:50 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tp9UD-0000xO-BL; Mon, 03 Mar 2025 17:21:50 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tp9UB-0000x2-5s for linux-f2fs-devel@lists.sourceforge.net; Mon, 03 Mar 2025 17:21:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=content-type:Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=3a71CP4rhUt2ebhd+8+Z2N85PjMH51h0fkBgqrQVK1g=; b=d8Cy1jAvHd6F3Xhp9MQTrbHJYN e6U4plm7uETNJWr1ZyeOcdqfRa3V9ieCRfzZxrBlEzRi3dcYqkhaj/HSW9yxVXMNnY4BE6OvNSRIf 3guMPq9a1/HdkeJ5LKvm7ULQwtSri4H+IwLWYD63spcPypfT2aSQXxR10mfdRTwqMYdE=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=content-type:Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=3a71CP4rhUt2ebhd+8+Z2N85PjMH51h0fkBgqrQVK1g=; b=bQSFxgnFJIASreshOSM8nwTS/o mxuXuKgTcZitZMlyLZdiEL65wrMGEJUJ991T52M/kFKpMeeLS6kOHbzZJTiQ86F0YtGY00KfslufG Bk1LlHsMKvd5XV8nOewbCI/xPYcoDPYH0eymBr9/Al3BOOz2QcJunnh+FCbrNHx8BN78=; Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1tp9UA-0008QM-4X for linux-f2fs-devel@lists.sourceforge.net; Mon, 03 Mar 2025 17:21:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741022495; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3a71CP4rhUt2ebhd+8+Z2N85PjMH51h0fkBgqrQVK1g=; b=Zuchck3X8bdcsZdU4oj2O9H5I/yn2wPqwzLRkXCth8xUvY3gaAQS2R6Hrgx0dgDttXyCkw EX4TUjKJtgFx0QmiEu4fU+8Tpm/7e/NG8Ry+dfMqdK2JFlIaqjf3MA+V66E98JqgCGQGQe ZgCahUDENgVZquko01for7xga3gFTPY= Received: from mail-io1-f69.google.com (mail-io1-f69.google.com [209.85.166.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-665-RBQ-GiF-Pky5I1h7bJBiCg-1; Mon, 03 Mar 2025 12:21:34 -0500 X-MC-Unique: RBQ-GiF-Pky5I1h7bJBiCg-1 X-Mimecast-MFC-AGG-ID: RBQ-GiF-Pky5I1h7bJBiCg_1741022493 Received: by mail-io1-f69.google.com with SMTP id ca18e2360f4ac-85adea539cbso174412739f.1 for ; Mon, 03 Mar 2025 09:21:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741022493; x=1741627293; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3a71CP4rhUt2ebhd+8+Z2N85PjMH51h0fkBgqrQVK1g=; b=QCApPs5MN5srdfsYXb2whnxQ1kqeZcODNqnaR+yc8Lqu0V9zAr6E9kqbNNcMEAJqw5 lV4NTNSM63wOwATvjx4q/1NmfXBplLzU2DYJ7qTG8XlF6YI2oV24TTv+1FpNdD291+oc hZp/ow5ae+Xwd/5ECdPdfAQpPsgPlSsl5U66tnQ5k1R9AI5Ynp+Y78LPgU2MnRolUBvQ jqUfAIVsM89729GNkko3or932XZUDbdnqg85ZxW7TADtSHG06T7ii334q0mMhrHi82/L sDZVEUbJ67SgtTmwgHCuT+sGpGWvF9Jl89dGf1Qx8dA2gKcnUlRQCQaX+yjuFX3xlA/s 66aA== X-Gm-Message-State: AOJu0YzA9FAzYP4bLYRHcUFeEtK/PABkos5ozzKLc533B184xRvLbBIv 5A+ZJrCAIRlVlFTLjssXMBAsydYh9OHDr0BBAkdsGeYlomaMhdDhBUjrtZvnzomKHzf7OqTNbYz 4ic9HhxLfOfmE2CCnCitMRJuhklx8q0d0Hy6xZufGEgqKMg5jxpvhR9URj99NObupT1jYCz0XcX eLfJ4bsa4lh5kprnj6zuc9xdn2tnPw7PRDRl6LsN2W/FrLAP0ddrw6GcT4dQ== X-Gm-Gg: ASbGncuhu7nlb2WJZ6M0Yyn195X79ulcvtIXeYrwfpFDoH70/GnwCJKKK5U/MXF6Som +CzS/ojBIMYNWHn1n5Vdh7HuaFnkt4YGeUazhLAOgWt0oslmDLo5g9DhKth7Pk/3yZBOvEF/qzo bqo6VKLS8ukCMQXsEDM0oyyqDL3LCQwQ2fcjyI2pSz1DIQaR665FdVb9dugb1bcs1AsL3QUnxDb vSr7Yl4LujRnGNbTPc7JVtoKF58MdLWDBbQmFHh/ndeoCNT8fps2+dGL74BRVdySapohAEpBs+n ZGhc2yLFUEJi7oX1wXiqbY+fY8ktKw0= X-Received: by 2002:a05:6602:3a81:b0:85a:ec03:b124 with SMTP id ca18e2360f4ac-85aec03b1edmr222852039f.4.1741022493447; Mon, 03 Mar 2025 09:21:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IHdB+2mmjIA6xrOj1G/sR+GfMIsrO4HpL6CaKlQ+6huwSCwGDZo9vSk87HI2Ud8mtJpqZBxag== X-Received: by 2002:a05:6602:3a81:b0:85a:ec03:b124 with SMTP id ca18e2360f4ac-85aec03b1edmr222848539f.4.1741022493139; Mon, 03 Mar 2025 09:21:33 -0800 (PST) Received: from fedora-rawhide.sandeen.net ([65.128.97.82]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-85add261b4csm49563939f.9.2025.03.03.09.21.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Mar 2025 09:21:32 -0800 (PST) From: Eric Sandeen To: linux-f2fs-devel@lists.sourceforge.net Date: Mon, 3 Mar 2025 11:12:13 -0600 Message-ID: <20250303172127.298602-4-sandeen@redhat.com> X-Mailer: git-send-email 2.48.0 In-Reply-To: <20250303172127.298602-1-sandeen@redhat.com> References: <20250303172127.298602-1-sandeen@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: GAOHrf0nZAccjaOzXgIsjSlTR4wo6bWgn2gC-vWTMy4_1741022493 X-Mimecast-Originator: redhat.com X-Headers-End: 1tp9UA-0008QM-4X Subject: [f2fs-dev] [PATCH 3/9] f2fs: factor out an f2fs_default_check function X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jaegeuk@kernel.org, Eric Sandeen , lihongbo22@huawei.com, Eric Sandeen Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net From: Eric Sandeen The current options parsing function both parses options and validates them - factor the validation out to reduce the size of the function and make transition to the new mount API possible, because under the new mount API, options are parsed one at a time, and cannot all be tested at the end of the parsing function. Signed-off-by: Eric Sandeen Reviewed-by: Chao Yu --- fs/f2fs/super.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 29b3aa1ee99c..7cfd5e4e806e 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -687,7 +687,7 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount) int ret; if (!options) - goto default_check; + return 0; while ((p = strsep(&options, ",")) != NULL) { int token; @@ -1318,7 +1318,11 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount) return -EINVAL; } } -default_check: + return 0; +} + +static int f2fs_default_check(struct f2fs_sb_info *sbi) +{ #ifdef CONFIG_QUOTA if (f2fs_check_quota_options(sbi)) return -EINVAL; @@ -2364,6 +2368,10 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data) } #endif + err = f2fs_default_check(sbi); + if (err) + goto restore_opts; + /* flush outstanding errors before changing fs state */ flush_work(&sbi->s_error_work); @@ -4489,6 +4497,10 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) if (err) goto free_options; + err = f2fs_default_check(sbi); + if (err) + goto free_options; + sb->s_maxbytes = max_file_blocks(NULL) << le32_to_cpu(raw_super->log_blocksize); sb->s_max_links = F2FS_LINK_MAX; From patchwork Mon Mar 3 17:12:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 13999302 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0B9C7C282D1 for ; Mon, 3 Mar 2025 17:22:00 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tp9UM-0000zF-UM; Mon, 03 Mar 2025 17:21:59 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tp9UL-0000yt-J5 for linux-f2fs-devel@lists.sourceforge.net; Mon, 03 Mar 2025 17:21:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=content-type:Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=KK1GgQVMwTeet01ybpOk9tWnDU1x3paagR1u3Pnbig4=; b=e8XMUodo+kqynAxDBQmMBm0vLO fFjeKUqFCQ5pKoA7KP2zY9gFmmkcWg4lxzlZBO45t7RRgyChn8fogVPHnKtIvSInkz1d7bdzh7bkn xM7M0QR9tsdvf4xnheQHSEGbwrMIYu8TgCToMoYe218rDFYr+91+GsnqXFZATaIFR7Os=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=content-type:Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=KK1GgQVMwTeet01ybpOk9tWnDU1x3paagR1u3Pnbig4=; b=iItyCtBJkQbWb8gT49NrgM29ht bF/P/E87kY6uuKi4r9iT5tvUlGXi6zam+tLdP02o2hHizaBvsXjTZ0fSIY0m4tML6vEShvnU4yYOD PYMAzaazSAOlbdbiiLuuyu3CBLleBeV8v8QiAMv2axci2gvrfbSidLBzfxq79PlOFHFs=; Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1tp9UB-0008QO-M2 for linux-f2fs-devel@lists.sourceforge.net; Mon, 03 Mar 2025 17:21:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741022496; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KK1GgQVMwTeet01ybpOk9tWnDU1x3paagR1u3Pnbig4=; b=FATMjDjFckc+SbAtBq8wqU1mss3c3lRV1KjC/WgZ44hgkb9/Bn4sgfxr2T7GJZnVxEdwft wWXVrbmduvh0EWhtEO8elGcaBZYNcWy4sEEWuMaQ+/EJdypO4S81BBADypDWfgtyHe1LAw ZKhqpTpZ2Kncj5LbZOAUFAVLYUU0GfE= Received: from mail-io1-f69.google.com (mail-io1-f69.google.com [209.85.166.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-629-ewsgdmS3Owaej9aEGU359A-1; Mon, 03 Mar 2025 12:21:35 -0500 X-MC-Unique: ewsgdmS3Owaej9aEGU359A-1 X-Mimecast-MFC-AGG-ID: ewsgdmS3Owaej9aEGU359A_1741022495 Received: by mail-io1-f69.google.com with SMTP id ca18e2360f4ac-855a5457110so438973239f.3 for ; Mon, 03 Mar 2025 09:21:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741022495; x=1741627295; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KK1GgQVMwTeet01ybpOk9tWnDU1x3paagR1u3Pnbig4=; b=sPg+8vnJ8b2vWd2ZDx53m+MvkEY0PhoXxKXOgPqeEuc+w7QkcE9IOIAMePmnj9BJca xhEAigPhdls5ASQLXNndASqacba6Q3WTBcjRX3Ok49S2b5HxmPWU1IodAfFwQADtsnpp mNBxmdThlKsYXAcRJwjXuEnC21ZZsbbvdVFvdkWFtgtEVf9Dx3/Tfla59UCyvfNqlXYb ouUNq9RzFY1+kUzHR91LhobMruXTzjR9ZPock9IfiLM/4oEjaYRK+SNpZsXcmo2RqhyS HHbWZ56XHKclO4KLd8X68KSPV7FMhjE0W7bAMgnp+CT0RQaWA55eQphIfaNkxb1xPa/O G/KA== X-Gm-Message-State: AOJu0Yykqln6IXDDL+afz3zpq28dvXNBT5kA9hLtM7XxjXipmaKeEpWd QOuJnzg4MEwuviCcXgZtTXQTXWekzoc3OfP6m1hdPa2xVuL1AKz+VMjUqHev5KVsczW2l5h2kJ0 bk2UG4Gx55DR6jIHRPZwJkD+EJHHlGaRkvLkbLvAw+FvUf0vjIIy2jj3Rr1p+1IgTGlA3RZDsQ3 rnwN/D0vk/ITQX6FAyIkK4uCAQrwbr+wTd05O1CZWSEfWo/DnbaGCsuqT3+Q== X-Gm-Gg: ASbGncuq0DGUNoz0EKR0KIS/4ytr/oJvRLEodK4JF36Q3VhEgkbyXubwfqi2h74V+fm j0cIVwAiFj+L/CH3sBuDs23/i2WI94d+PVklCeaPgya/Myg3CM56ufNoLGgi/HBTe5RIpeUcDWO nGAn1LC8Rubcc68noxQ9Pr+zGa6oRoJhR1BrRCoBOHplYp3m4714r/Jmn+V1GSJeUtbYFlPybs9 YUWzMTwmXrur4aBND3xvBlLIpKYBqerFjrtHFOUUsodyY0P2j82OLkoNO7j/P6hI99gKKjVISiz QVKCMb7rLMs9FGnZslldmjRzb+ji9ks= X-Received: by 2002:a05:6602:601c:b0:851:efec:53ad with SMTP id ca18e2360f4ac-85881f2fe85mr1488417539f.7.1741022494737; Mon, 03 Mar 2025 09:21:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IGGTCqJ3svTWS7P8zrmjirxjCDnlIgb50sBjs7nrRoo7HXigvIdJ2BFDESd/oh4roTgxExtyQ== X-Received: by 2002:a05:6602:601c:b0:851:efec:53ad with SMTP id ca18e2360f4ac-85881f2fe85mr1488413739f.7.1741022494344; Mon, 03 Mar 2025 09:21:34 -0800 (PST) Received: from fedora-rawhide.sandeen.net ([65.128.97.82]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-85add261b4csm49563939f.9.2025.03.03.09.21.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Mar 2025 09:21:33 -0800 (PST) From: Eric Sandeen To: linux-f2fs-devel@lists.sourceforge.net Date: Mon, 3 Mar 2025 11:12:14 -0600 Message-ID: <20250303172127.298602-5-sandeen@redhat.com> X-Mailer: git-send-email 2.48.0 In-Reply-To: <20250303172127.298602-1-sandeen@redhat.com> References: <20250303172127.298602-1-sandeen@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: sT_uLqg17YIDU40NIsoaNoc0hxejU3cpWJ212knGJZs_1741022495 X-Mimecast-Originator: redhat.com X-Headers-End: 1tp9UB-0008QO-M2 Subject: [f2fs-dev] [PATCH 4/9] f2fs: make INLINECRYPT a mount option flag X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jaegeuk@kernel.org, Eric Sandeen , lihongbo22@huawei.com, Eric Sandeen Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net From: Eric Sandeen Set INLINECRYPT into sbi during parsing, and transfer it to the sb in fill_super, so that an sb is not required during option parsing. Signed-off-by: Eric Sandeen Reviewed-by: Chao Yu --- fs/f2fs/f2fs.h | 1 + fs/f2fs/super.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 1afa7be16e7d..15e4f5a77eb5 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -114,6 +114,7 @@ extern const char *f2fs_fault_name[FAULT_MAX]; #define F2FS_MOUNT_GC_MERGE 0x02000000 #define F2FS_MOUNT_COMPRESS_CACHE 0x04000000 #define F2FS_MOUNT_AGE_EXTENT_CACHE 0x08000000 +#define F2FS_MOUNT_INLINECRYPT 0x10000000 #define F2FS_OPTION(sbi) ((sbi)->mount_opt) #define clear_opt(sbi, option) (F2FS_OPTION(sbi).opt &= ~F2FS_MOUNT_##option) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 7cfd5e4e806e..643d19bbc156 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -1036,7 +1036,7 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount) break; case Opt_inlinecrypt: #ifdef CONFIG_FS_ENCRYPTION_INLINE_CRYPT - sb->s_flags |= SB_INLINECRYPT; + set_opt(sbi, INLINECRYPT); #else f2fs_info(sbi, "inline encryption not supported"); #endif @@ -4535,6 +4535,9 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) sb->s_time_gran = 1; sb->s_flags = (sb->s_flags & ~SB_POSIXACL) | (test_opt(sbi, POSIX_ACL) ? SB_POSIXACL : 0); + if (test_opt(sbi, INLINECRYPT)) + sb->s_flags |= SB_INLINECRYPT; + super_set_uuid(sb, (void *) raw_super->uuid, sizeof(raw_super->uuid)); super_set_sysfs_name_bdev(sb); sb->s_iflags |= SB_I_CGROUPWB; From patchwork Mon Mar 3 17:12:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 13999297 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2FC59C282CD for ; Mon, 3 Mar 2025 17:21:49 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tp9UC-0007e7-GC; Mon, 03 Mar 2025 17:21:47 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tp9UB-0007e1-Fy for linux-f2fs-devel@lists.sourceforge.net; Mon, 03 Mar 2025 17:21:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=content-type:Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Rl1o+sBEhbKAJC9JIKkS/yC1Fh56NdcUPRuJTNKItws=; b=Il3aJZS+A9nPdM7d/DDo27M8mi eNoD0X1dE99Ckk9c1oWAMeqX/IvoN/XLjDfQ+MkWNJgVRFnJ6Z8Fq0RBjx7rWmqw1ZgYuiOl9dqjP UYoRLq1eUORg2TWuWIuNj5MQ9OtSjMuxt1Ndr6yOQugeQef0HajkIpJS6JzBsxfwbDdA=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=content-type:Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Rl1o+sBEhbKAJC9JIKkS/yC1Fh56NdcUPRuJTNKItws=; b=hLvsEPWIiBGYQWg0F8fJuCVEUq dKo0fizYl3RaosCl/WA5wdTsMXuZvrEyvbaYCWa32RaPy0h/IfFE6dDYt7QfZ1etIzX+FeDHYmLGt 0zM376S71LdBrj4h5bAjZsQoIJZQK1SE0pBSQ3eRRKNJVkM8lO8k7SjIXPIGcgue1YPI=; Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1tp9U8-0008QI-Qn for linux-f2fs-devel@lists.sourceforge.net; Mon, 03 Mar 2025 17:21:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741022498; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Rl1o+sBEhbKAJC9JIKkS/yC1Fh56NdcUPRuJTNKItws=; b=gNQOVolpRTaXcFkwUzbEcoLvq2AYLjBK5p9fiuiXt3/JFXRSU2ncGq2m/JRYYdpHk4kvAa LoypovglAS54ZSzwV3rWkxy3wjurcYZ/T+1jv6Mx72hoqICzYdmZSxwqLLyUI4G23MgVIF 48StEd6gf6viH9kjB0newA4Qzp1A+T4= Received: from mail-io1-f72.google.com (mail-io1-f72.google.com [209.85.166.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-626-2o7_KJzoP2SUZNSJ-HQwYQ-1; Mon, 03 Mar 2025 12:21:37 -0500 X-MC-Unique: 2o7_KJzoP2SUZNSJ-HQwYQ-1 X-Mimecast-MFC-AGG-ID: 2o7_KJzoP2SUZNSJ-HQwYQ_1741022496 Received: by mail-io1-f72.google.com with SMTP id ca18e2360f4ac-85ad875acccso315996739f.3 for ; Mon, 03 Mar 2025 09:21:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741022496; x=1741627296; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Rl1o+sBEhbKAJC9JIKkS/yC1Fh56NdcUPRuJTNKItws=; b=gweriz+vHPrscVrBT5nrN63h1CNInDiCECWPik61eEh/MYgcE/0cBMHGGvMQcs3fAK NCDwGF7XMtrQjbpNRTKYBxk2a3pNGmVwL1Cg1SjlDz0/yB0z9Ba84TioiE5EGV+omaEo qE88GJcqH/GGWcouU+KpS0Yg4WePAr+FJwHXtVI61futAjxuaRag3mhFkgJHGDSyss/q sPXq/l57IM7KAQaf+C2D3yz6xF0ROXXSbzL8rmdDLEAP1BEUr+cQEAFS/hwDYM5OLQ/x d1Vtiz3oIcat90QvU8sGM+dRSFG/tEfhUJDGUng8Gux5fmX9CNABi21BKUAXJ+BrYh1G eWXA== X-Gm-Message-State: AOJu0Yw72zeYj56L6n4K2SO+sBWQQQublOPt4Y++TLx15zbYn+Nuajp/ TmNaW6GVqEDd0+reW3JewSiMVYBOiUOqLxNYOQJ8XSy0tuMqpPRTkIxOKctvlvKkRhwEh3K66NM Vtrs0kTw0s4btGYsixD/FbwioeczX7OrNxzlrB17IRLboDXGcjT25SSVKFXMd0MaHvT5Z/Kt2Z7 PLy5/Saph78ehwvhrcfp0KxBtTN0Wu4QPkzY0EU1CZ5xT+gxMbwb+Dpm4fRw== X-Gm-Gg: ASbGncs0kLLHD6H1blzwoeSIp2LZYrGytdhDFGfxSpx4kGkYgG3vCOcHWyqQ+I4kZ0H LQlEUJeY+kr4MGywyy/AvhwY3IDyoUcVA3NaK3atonqKunnNbt1cYHOQocoGMnM7xGVFFjMzmZ7 M2QRbnH0wDt4VHwcUdCYzCwVhrb7q8w2K99Jk0xOW3ierEakNISBNC2tWsb9aTROHBHQsOpm4w+ 0jq/AcrCcKny9GbULOIJ353MwLKjB1+lY38iUuMsbnYnlbQxaO2dLcuI5LCsKumhOi/CnGM6Ixv 982tTLWZKex5UFs0QqMDLxaBlbfnWnU= X-Received: by 2002:a05:6602:3589:b0:85a:e279:1ed6 with SMTP id ca18e2360f4ac-85ae27922a1mr324575039f.11.1741022496029; Mon, 03 Mar 2025 09:21:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IHiJdtMwxnkHK4nis29c/wQxEv7UYVhulmibA/kl6bWfq5i7ikY+z/the2I7C2Yn/zXqdkqxQ== X-Received: by 2002:a05:6602:3589:b0:85a:e279:1ed6 with SMTP id ca18e2360f4ac-85ae27922a1mr324571239f.11.1741022495677; Mon, 03 Mar 2025 09:21:35 -0800 (PST) Received: from fedora-rawhide.sandeen.net ([65.128.97.82]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-85add261b4csm49563939f.9.2025.03.03.09.21.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Mar 2025 09:21:34 -0800 (PST) From: Eric Sandeen To: linux-f2fs-devel@lists.sourceforge.net Date: Mon, 3 Mar 2025 11:12:15 -0600 Message-ID: <20250303172127.298602-6-sandeen@redhat.com> X-Mailer: git-send-email 2.48.0 In-Reply-To: <20250303172127.298602-1-sandeen@redhat.com> References: <20250303172127.298602-1-sandeen@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: dFk9UkjfGi1W8M2cE7gARHp-DYOf9lp3v3R3Qf6dyiE_1741022496 X-Mimecast-Originator: redhat.com X-Headers-End: 1tp9U8-0008QI-Qn Subject: [f2fs-dev] [PATCH 5/9] f2fs: make LAZYTIME a mount option flag X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jaegeuk@kernel.org, lihongbo22@huawei.com, Eric Sandeen Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Set LAZYTIME into sbi during parsing, and transfer it to the sb in fill_super, so that an sb is not required during option parsing. (Note: While lazytime is normally handled via mount flag in the vfs, some f2fs users do expect to be able to use it as an explicit mount option string via the mount syscall, so this option must remain.) Signed-off-by: Eric Sandeen Reviewed-by: Chao Yu --- fs/f2fs/f2fs.h | 5 +++++ fs/f2fs/super.c | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 15e4f5a77eb5..5c83e3a558f9 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -115,6 +115,11 @@ extern const char *f2fs_fault_name[FAULT_MAX]; #define F2FS_MOUNT_COMPRESS_CACHE 0x04000000 #define F2FS_MOUNT_AGE_EXTENT_CACHE 0x08000000 #define F2FS_MOUNT_INLINECRYPT 0x10000000 +/* + * Some f2fs environments expect to be able to pass the "lazytime" option + * string rather than using the MS_LAZYTIME flag, so this must remain. + */ +#define F2FS_MOUNT_LAZYTIME 0x20000000 #define F2FS_OPTION(sbi) ((sbi)->mount_opt) #define clear_opt(sbi, option) (F2FS_OPTION(sbi).opt &= ~F2FS_MOUNT_##option) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 643d19bbc156..e63b3bd75f85 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -917,10 +917,10 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount) break; #endif case Opt_lazytime: - sb->s_flags |= SB_LAZYTIME; + set_opt(sbi, LAZYTIME); break; case Opt_nolazytime: - sb->s_flags &= ~SB_LAZYTIME; + clear_opt(sbi, LAZYTIME); break; #ifdef CONFIG_QUOTA case Opt_quota: @@ -2169,8 +2169,8 @@ static void default_options(struct f2fs_sb_info *sbi, bool remount) set_opt(sbi, INLINE_DATA); set_opt(sbi, INLINE_DENTRY); set_opt(sbi, MERGE_CHECKPOINT); + set_opt(sbi, LAZYTIME); F2FS_OPTION(sbi).unusable_cap = 0; - sbi->sb->s_flags |= SB_LAZYTIME; if (!f2fs_is_readonly(sbi)) set_opt(sbi, FLUSH_MERGE); if (f2fs_sb_has_blkzoned(sbi)) @@ -4538,6 +4538,11 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) if (test_opt(sbi, INLINECRYPT)) sb->s_flags |= SB_INLINECRYPT; + if (test_opt(sbi, LAZYTIME)) + sb->s_flags |= SB_LAZYTIME; + else + sb->s_flags &= ~SB_LAZYTIME; + super_set_uuid(sb, (void *) raw_super->uuid, sizeof(raw_super->uuid)); super_set_sysfs_name_bdev(sb); sb->s_iflags |= SB_I_CGROUPWB; From patchwork Mon Mar 3 17:12:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 13999305 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EC02AC282D1 for ; Mon, 3 Mar 2025 17:22:02 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tp9UR-0007fU-7P; Mon, 03 Mar 2025 17:22:02 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tp9UP-0007fF-Sv for linux-f2fs-devel@lists.sourceforge.net; Mon, 03 Mar 2025 17:22:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=content-type:Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=tnfeTGnJi9mN0JKSqbiJYiLPQIxUPyH6sS/f3rf+dfg=; b=dNRh2qVK7eEmqDlII9QYbAApyh bTO1uU9lb7fKcAOrCBOgwGfSxKJqq2aoDa4jViB3S44tU5LOdfAEK1zIfbWSapy2cidEz0M03GAhN X7K5Ockn93w0rJcmXkVAfmLd5UK5lcuH2u0SuR3R/W8Zq8Ey1iW6z4N+g98Jdw5NMvE8=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=content-type:Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=tnfeTGnJi9mN0JKSqbiJYiLPQIxUPyH6sS/f3rf+dfg=; b=ZJB7jRMjWLcqCa92vNct/zoXMc Hm33bSkn3hYBF9ZxY6y62ddCDe5ZuTj142ghb6MTizAo2XbH0eW9h0IRFV0FQB8soCxL2RbjfqJxw +DdkXef/HjKl1ogsfCjl/iUpT0uRS4e8cRRsnl9eII6fQEEc0ypDM+8o/LdvAx0fnYcc=; Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1tp9UO-0008R8-KM for linux-f2fs-devel@lists.sourceforge.net; Mon, 03 Mar 2025 17:22:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741022509; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tnfeTGnJi9mN0JKSqbiJYiLPQIxUPyH6sS/f3rf+dfg=; b=YSfm2o+LnBeXsSiEmjG9bD0Jdkc/gaGORSePO037D6lPBO4NZYJs7Y181mcw8pt2Ojn/12 LbwYOJCSSDVeKhZLLwCuk6rVOhg4G7LS1rGyp3SIjP0rMHv1aD4sWXONCwPMptzPQqFcwv kwFiAuHsg6ZRy6eizCjl4DW8XfJ4VQY= Received: from mail-io1-f70.google.com (mail-io1-f70.google.com [209.85.166.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-39-SH1-h1-zMq--MALyqY1lKg-1; Mon, 03 Mar 2025 12:21:38 -0500 X-MC-Unique: SH1-h1-zMq--MALyqY1lKg-1 X-Mimecast-MFC-AGG-ID: SH1-h1-zMq--MALyqY1lKg_1741022497 Received: by mail-io1-f70.google.com with SMTP id ca18e2360f4ac-85ae5190d4fso86849839f.3 for ; Mon, 03 Mar 2025 09:21:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741022497; x=1741627297; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tnfeTGnJi9mN0JKSqbiJYiLPQIxUPyH6sS/f3rf+dfg=; b=WwCCQ6PpQi+Ew/TwgHwMJI4mvmcRJB1rJwZSerQq6ekm1LlfhJHzqqGLoQax6owRXP ZxTvoavT7VXvzbrDLK5Yihfg7amlhGW6Y4ZTOW9egrcLkHbEepFxadMouutY1nEOlUse KZERoEi/GEiMOgQKWjnfeCkKTaRiXrh5l+xmMAYvwC3JF3y99mCRG0fab5F7I5wRgYyb CwqNxvmlDVigL0+Hyat9hrQOY59M060q2+cM/rp9uJRRblHB4v+bXPEkHZj4bYf8mSY6 MirniVYWLu2dso4N+1K4FUtLOXJGrULp9NMZ/JMekx53KDmnudrJ0XmWJry9wfFqz59P EFaw== X-Gm-Message-State: AOJu0Yzs1/3hFpYW6ERMt8jmHrFUoLQvdHaxXP/rLrt1NA5t1XTwO5G/ 6wfiviJ1As9qS20Q/icS1RzV8yfblpBezPvtcYidTluBDlFcdu/yKHfEeOCdUz8JgLZOV5D7vdI 3neDvekRv4V2LJ3BQYyCk8gfkrQVotPENFMtMjMIgRiFcORLJ/sPWZOIbTRugnjFBi5LrStJedT /9jIgLepSdkulyx6MsXgt9DpICfme+MkGfFUBrs+ee2MmCSJXDuhbE1NlY0w== X-Gm-Gg: ASbGnctvUGvAIxRGEyJl2Vm44tTGWBsva0IvLjoQg36OrSUtb72QZK9+wCCxIXuM0Yu NFIhBQ9DR8Kr8r2mbcFREAqlHyM3SqASWYETBd5UzTbV+DwdwG/7pDhKmh0cTRYa7LDn3PWrQEt lO5rkkx6Nm7u8gu2WRFmklEOY4FDqbQCL365ODccOpELwAh11QN/05KT6w0Phm9RQr2chD3GdC0 b+PAiKCXBlUUYvSZksy+RcP/F2PQrIo8DcIxcAe0dhs3bph0LDzCi/NejH5EaARn5VdZaamw5/Q r0KYIhMRm1RPtbh8df3/qdsWohBTuZ8= X-Received: by 2002:a05:6602:3fd1:b0:84f:2929:5ec0 with SMTP id ca18e2360f4ac-85881f0a0c1mr1739259139f.4.1741022497162; Mon, 03 Mar 2025 09:21:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IGtcYrPGoZKO383dfBXmGjrDcSGSI7XeGVAbKYy3Z1KkphtsM5+lcv/SaNbCjkonoe+cOhbrA== X-Received: by 2002:a05:6602:3fd1:b0:84f:2929:5ec0 with SMTP id ca18e2360f4ac-85881f0a0c1mr1739255939f.4.1741022496833; Mon, 03 Mar 2025 09:21:36 -0800 (PST) Received: from fedora-rawhide.sandeen.net ([65.128.97.82]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-85add261b4csm49563939f.9.2025.03.03.09.21.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Mar 2025 09:21:36 -0800 (PST) From: Eric Sandeen To: linux-f2fs-devel@lists.sourceforge.net Date: Mon, 3 Mar 2025 11:12:16 -0600 Message-ID: <20250303172127.298602-7-sandeen@redhat.com> X-Mailer: git-send-email 2.48.0 In-Reply-To: <20250303172127.298602-1-sandeen@redhat.com> References: <20250303172127.298602-1-sandeen@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: Q4xRYwDfEsC7W7r2F_PRhTR6OJdeiE_iUxvE8jEe01Y_1741022497 X-Mimecast-Originator: redhat.com X-Headers-End: 1tp9UO-0008R8-KM Subject: [f2fs-dev] [PATCH 6/9] f2fs: Pass sbi rather than sb to f2fs_set_test_dummy_encryption X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jaegeuk@kernel.org, lihongbo22@huawei.com, Eric Sandeen Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net This removes another sb instance from parse_options() Signed-off-by: Eric Sandeen Reviewed-by: Chao Yu --- fs/f2fs/super.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index e63b3bd75f85..8866a74ce6aa 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -483,12 +483,11 @@ static int f2fs_check_quota_options(struct f2fs_sb_info *sbi) } #endif -static int f2fs_set_test_dummy_encryption(struct super_block *sb, +static int f2fs_set_test_dummy_encryption(struct f2fs_sb_info *sbi, const char *opt, const substring_t *arg, bool is_remount) { - struct f2fs_sb_info *sbi = F2FS_SB(sb); struct fs_parameter param = { .type = fs_value_is_string, .string = arg->from ? arg->from : "", @@ -1029,7 +1028,7 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount) kfree(name); break; case Opt_test_dummy_encryption: - ret = f2fs_set_test_dummy_encryption(sb, p, &args[0], + ret = f2fs_set_test_dummy_encryption(sbi, p, &args[0], is_remount); if (ret) return ret; From patchwork Mon Mar 3 17:12:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 13999306 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 64F55C282CD for ; Mon, 3 Mar 2025 17:22:26 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tp9Un-00013I-9c; Mon, 03 Mar 2025 17:22:26 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tp9Ul-00012z-VF for linux-f2fs-devel@lists.sourceforge.net; Mon, 03 Mar 2025 17:22:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=content-type:Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=j2WbdJlNdbhkCclRf7c22dSf77+O9W2lmcMP4hLabTY=; b=gwfhT242sgIUr7oudt/UQlfX8k 9kdV6577wWFgJikH6kr8Mffl5qwsKwR8jhoTqaPF0oCj42ZysRulKADX4QeQ3I0DJg5vUBZ8+JBZs CZYKlJSPV7XL6cz44VSaQIkbG/cm3EZSLB48eIlW8V1KMoMGbK+qrJZG0emd+SVcu9UU=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=content-type:Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=j2WbdJlNdbhkCclRf7c22dSf77+O9W2lmcMP4hLabTY=; b=SJz0lUFWFFyYVrbLtsevo5oWIE WuPWL9WhX8N6FqIR38VWlTtY8n8Apem47DEOAir/4P+3PNXE4gTEJbwrTMRAZA0ywxTtgsBn8ENbx BtbF57dIRzb9Zor/teYePW00uML9yMsGtdfp/Ocdd+jBOKWEZqspHUnKaxQ7kN9Em1g0=; Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1tp9Uc-0008Rl-0h for linux-f2fs-devel@lists.sourceforge.net; Mon, 03 Mar 2025 17:22:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741022518; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=j2WbdJlNdbhkCclRf7c22dSf77+O9W2lmcMP4hLabTY=; b=Bk7YMBxurdbAYk14dzbAK2JzjdXEbt1OH/18cVHyTL8BPlA6dGVR1kKLDoiVu5lgd0ZoWq tNvUKJ7NiEwi/uhLew/eBxSxe3mGEtLqVlNQ0+bph/KKdZ26xfsCzL1VJaapct3ZLoJHdi 5TxhF1qF4sDwNGYuP3VaWJLtGKlA2b0= Received: from mail-io1-f71.google.com (mail-io1-f71.google.com [209.85.166.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-45-SjuGXMPHPnSEhoMsinwPJg-1; Mon, 03 Mar 2025 12:21:40 -0500 X-MC-Unique: SjuGXMPHPnSEhoMsinwPJg-1 X-Mimecast-MFC-AGG-ID: SjuGXMPHPnSEhoMsinwPJg_1741022499 Received: by mail-io1-f71.google.com with SMTP id ca18e2360f4ac-85ae1c53d9fso61786339f.1 for ; Mon, 03 Mar 2025 09:21:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741022498; x=1741627298; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=j2WbdJlNdbhkCclRf7c22dSf77+O9W2lmcMP4hLabTY=; b=rGRlHNPHPX7J11LBoecO9LBBYTJ/1qF5fxTv3308ZQ0NaRLAKdA6QiGMcmF+ZQaSDk Gv2qOuPoz3a9cMBfW2Rwequ6gzqSw1yB/eYaQ68NJnxlOWHX25sRGTwrxglW1Wq1CKdT KNYadVOyDAUDgtEBRBVKGE7UZeqrbX+dx3KH9tk64CGjGqFw7peppxa7Y22thyck0Kxj DT9g/mSSTRygAXt7tO+30wXLSXIEI4ME5MnQKEyQJzSGaH4XpKiNHtnEMZ36bhAKSfqy avNz6B+5ElvOWQk3OTf67Hw2iW8vWUcG271F0iMH0J+47u8a5clsZOqN08UsEozdESqP j7vA== X-Gm-Message-State: AOJu0YyjFLbB4c4BAqfNN0gLoEpWV1IzccwJ2y40LwN5cnmmJWZtAh/N r33bENpzSKQe87IlA2iu4J9dedB5Yy03wCRCKJo2VW9ODYf892dkVcoR6nOJuz/ouw5edyEz8J4 f9n5dhTSEAzHpys4CGud/gzUCxZ2jgk/oahxYK95eY7prPeC1lB65EdiXim45Zhz1IKiCfyRucl EGueiRv4s/TY/DAGGx13Jd9nitwRgWuZutDkBmIs2qgyyaAxSVqa0e1N1TyQ== X-Gm-Gg: ASbGncuxMhvCIDqiyt6D7tvzo3AH+uDk/G3HYUA4BVHyG+b45l+HzAqyMhc9/Qjj5ev IrOFHzl0jYZ/hE3NGNvLdWT9+YK66jwWy17/iC4LCuyEmMbmXrn9f0bSA04aXl+AXmr4CVVMhfs eoP0qq03Y6vr7nuS/I3NsQg3arEmuDhjpXYqdftIz6Z3WHOdGBYsB2AZoaf4m1NGjzO4XOeYhvq OQlG3Y0A4kQHGbG5KmA1bMXomPoSxzu5WCFIRpMwL62dOKB7JihYab8C4bIQOUx5INFDF51cFLK r6pXfZCa8dOB6tjZhnFhmdmpAt7kgU4= X-Received: by 2002:a05:6602:148d:b0:855:bd9c:7180 with SMTP id ca18e2360f4ac-85881f71692mr1510315939f.9.1741022498532; Mon, 03 Mar 2025 09:21:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IEWaLuZxAD9vSRShq4AQ4+cBdGetOHBZWS4uRNdKPzL2QMXwvJ3R2CHnBVqynGAkZlbLd4LpA== X-Received: by 2002:a05:6602:148d:b0:855:bd9c:7180 with SMTP id ca18e2360f4ac-85881f71692mr1510312539f.9.1741022498057; Mon, 03 Mar 2025 09:21:38 -0800 (PST) Received: from fedora-rawhide.sandeen.net ([65.128.97.82]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-85add261b4csm49563939f.9.2025.03.03.09.21.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Mar 2025 09:21:37 -0800 (PST) From: Eric Sandeen To: linux-f2fs-devel@lists.sourceforge.net Date: Mon, 3 Mar 2025 11:12:17 -0600 Message-ID: <20250303172127.298602-8-sandeen@redhat.com> X-Mailer: git-send-email 2.48.0 In-Reply-To: <20250303172127.298602-1-sandeen@redhat.com> References: <20250303172127.298602-1-sandeen@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: I7kQCi0LQAijGDOP7RGnykGJMkseMkfzpakVYwQSHW8_1741022499 X-Mimecast-Originator: redhat.com X-Headers-End: 1tp9Uc-0008Rl-0h Subject: [f2fs-dev] [PATCH 7/9] f2fs: defer readonly check vs norecovery X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jaegeuk@kernel.org, lihongbo22@huawei.com, Eric Sandeen Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Defer the readonly-vs-norecovery check until after option parsing is done so that option parsing does not require an active superblock for the test. Add a helpful message, while we're at it. (I think could be moved back into parsing after we switch to the new mount API if desired, as the fs context will have RO state available.) Signed-off-by: Eric Sandeen Reviewed-by: Chao Yu --- fs/f2fs/super.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 8866a74ce6aa..bc1aab749689 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -727,10 +727,8 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount) set_opt(sbi, DISABLE_ROLL_FORWARD); break; case Opt_norecovery: - /* this option mounts f2fs with ro */ + /* requires ro mount, checked in f2fs_default_check */ set_opt(sbi, NORECOVERY); - if (!f2fs_readonly(sb)) - return -EINVAL; break; case Opt_discard: if (!f2fs_hw_support_discard(sbi)) { @@ -1411,6 +1409,12 @@ static int f2fs_default_check(struct f2fs_sb_info *sbi) f2fs_err(sbi, "Allow to mount readonly mode only"); return -EROFS; } + + if (test_opt(sbi, NORECOVERY) && !f2fs_readonly(sbi->sb)) { + f2fs_err(sbi, "norecovery requires readonly mount"); + return -EINVAL; + } + return 0; } From patchwork Mon Mar 3 17:12:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 13999303 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3AC24C282CD for ; Mon, 3 Mar 2025 17:22:01 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tp9UO-0000e8-D3; Mon, 03 Mar 2025 17:22:00 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tp9UN-0000dx-0b for linux-f2fs-devel@lists.sourceforge.net; Mon, 03 Mar 2025 17:21:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=content-type:Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=jhMVOwW3H25SRBRcW6vTZBMLdzysvJyHmkhw4wCPOsk=; b=H7rArY8fjM+H1bJ1x+CU10MMRD 02wuiytFLFm+lQURH+bkDywwI1iZOxgUWFNZzl19w9CycELEGJtmwOZDbRDI+Gkz4kyYvisH0AuhF SYFUyO3eGqc+GPHDJIgYGrzbSRo5cNrYmkn3dKAR7+JhddcV0oV46yvl4jc94sEfeduY=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=content-type:Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=jhMVOwW3H25SRBRcW6vTZBMLdzysvJyHmkhw4wCPOsk=; b=dZLJvibtOhIGz1VjdR/fqJML+j KfZW+Dyuvh5sxTgLsctt7LezVluFgz1hk65z+c8/tBlPxqrB6VHf669EPNsfOSrVmsrTwZzzkm+6s H35kkr/L+YYaZPkkOD+HjjWZ5orRdxsVpRCJ7H5wfcUBkSaWj8qM1lkFkf/pMlFzbx4w=; Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1tp9UH-0008Qk-PR for linux-f2fs-devel@lists.sourceforge.net; Mon, 03 Mar 2025 17:21:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741022502; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jhMVOwW3H25SRBRcW6vTZBMLdzysvJyHmkhw4wCPOsk=; b=eTFiG+6Oj6ReAOpMcPIaxVwAaUCTQ8MNKd8T0q0CyQe9vIt1K3mWHHlmXj8Mt2rfbUboE7 2SPFnclfQ5I8rb51MVbo1cSdCRp0zw+xmAUB1ZfLhlf6QBRvFOzmgDXXvTbgk73hlHjHFF PxtDoxzyRZlvS0ryNPHGdxtV2bl050A= Received: from mail-io1-f71.google.com (mail-io1-f71.google.com [209.85.166.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-269-Hhrk15CNOIaiTay_mpC9hQ-1; Mon, 03 Mar 2025 12:21:41 -0500 X-MC-Unique: Hhrk15CNOIaiTay_mpC9hQ-1 X-Mimecast-MFC-AGG-ID: Hhrk15CNOIaiTay_mpC9hQ_1741022501 Received: by mail-io1-f71.google.com with SMTP id ca18e2360f4ac-84cdb5795b0so387083439f.2 for ; Mon, 03 Mar 2025 09:21:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741022500; x=1741627300; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jhMVOwW3H25SRBRcW6vTZBMLdzysvJyHmkhw4wCPOsk=; b=B1Z9wPpSs0XuRIMTTiK8bcpGMcSC4Hh2XBpludi51Qb6pQkEGqZvOhSAT/tAGtNMTu RA/k/CxiL4uokJZf7qbIpWorTtvHUtyvwDWqMmr5KNBE1fLNUvw+RCqkFzG/M+Y00qs7 FewBtEBoGkPAWKiEwwRNN7WDJWn4QiYtkj47vACTR1qqgmkkO/cAwfCgy8e9pRhfr3j2 tQqCIK11uesvVJmlvt72nqjcOYQK3WYzHuHRLfQ5XMwtCT06Xj5CTVYJEsJk6CmnBNYZ nAfw4pL+Gknmb6sC2vqWZxYKJWRYUsrSlbLNAKyvheJEpQNHrMyT6KucQMfKuUELedSv 7EsQ== X-Gm-Message-State: AOJu0YzVej9hk8Ai1IoDLhKN8LkZ/oL5ThRkuaDp3aGd7LmM+oF9D30L LppsHbYYM5/qIERMuvdulUdFnKh3uJg4Oc6hzY1LORjoSWclRrQVrcmjc7z35fyO2vZ3uAaI28s BsZQOW7UGBa3FJ2fvxsdPPZReMt43T5vQrr2wY+3aBiXWqAQioruAqBO+K3HbIz1ZvXZQebRDDN HVeK23QZdqJS83H6nv3nPupci+/d+LHh835aMj210IxR2Xe48WUjAhayIwkQ== X-Gm-Gg: ASbGncs+0/hpEqIRiL5tHEWflI1/VmkrUgKRTzj5/jVCiRk/58d40q0kCDNn/hgffKl EVouGh4cDrywK+x96EFxQKkRZcdLcYGW2uCjeTbSREdc1m49pgmVa5Qp1ls6g49tfjICC0K5vMZ 2p8QSKGkdjXdzvb1kDQvf8UebPYb2+d6CjC5n4OW89x7btcLVqUY7wkl6hn9HQnJycKCqObwgGV yGLDMLMA2Qivnk46FoqoDAkKLTxqwPW8hJ+KRNStV0fOBWgkG3bMls0EPmE8r6ulnAUiLS4bhOg XoBbpTUMEO0cUw57GzhnX14mfNl0qbo= X-Received: by 2002:a05:6602:358d:b0:85a:e659:bed2 with SMTP id ca18e2360f4ac-85ae659c08emr277150539f.14.1741022500389; Mon, 03 Mar 2025 09:21:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IHnXJCJgDqxjIGN+geVWJUGs4v5reFOD8RlrrcsvrfSnNg08p3kpwBBFLeMKh6yzcNMSHUmWw== X-Received: by 2002:a05:6602:358d:b0:85a:e659:bed2 with SMTP id ca18e2360f4ac-85ae659c08emr277147539f.14.1741022500040; Mon, 03 Mar 2025 09:21:40 -0800 (PST) Received: from fedora-rawhide.sandeen.net ([65.128.97.82]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-85add261b4csm49563939f.9.2025.03.03.09.21.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Mar 2025 09:21:38 -0800 (PST) From: Eric Sandeen To: linux-f2fs-devel@lists.sourceforge.net Date: Mon, 3 Mar 2025 11:12:18 -0600 Message-ID: <20250303172127.298602-9-sandeen@redhat.com> X-Mailer: git-send-email 2.48.0 In-Reply-To: <20250303172127.298602-1-sandeen@redhat.com> References: <20250303172127.298602-1-sandeen@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: qSIs6iWks4HQh1-xLoqc8h-5RF3ewU9-qb6SlWQmgaE_1741022501 X-Mimecast-Originator: redhat.com X-Headers-End: 1tp9UH-0008Qk-PR Subject: [f2fs-dev] [PATCH 8/9] f2fs: pass sbi rather than sb to quota qf_name helpers X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jaegeuk@kernel.org, lihongbo22@huawei.com, Eric Sandeen Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net With the new mount api we will not have the superblock available during option parsing. Prepare for this by passing *sbi rather than *sb. For now, we are parsing after fill_super has been done, so sbi->sb will exist. Under the new mount API this will require more care, but do the simple change for now. Signed-off-by: Eric Sandeen Reviewed-by: Chao Yu --- fs/f2fs/super.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index bc1aab749689..9edb200caae7 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -383,10 +383,10 @@ static void init_once(void *foo) #ifdef CONFIG_QUOTA static const char * const quotatypes[] = INITQFNAMES; #define QTYPE2NAME(t) (quotatypes[t]) -static int f2fs_set_qf_name(struct super_block *sb, int qtype, +static int f2fs_set_qf_name(struct f2fs_sb_info *sbi, int qtype, substring_t *args) { - struct f2fs_sb_info *sbi = F2FS_SB(sb); + struct super_block *sb = sbi->sb; char *qname; int ret = -EINVAL; @@ -424,9 +424,9 @@ static int f2fs_set_qf_name(struct super_block *sb, int qtype, return ret; } -static int f2fs_clear_qf_name(struct super_block *sb, int qtype) +static int f2fs_clear_qf_name(struct f2fs_sb_info *sbi, int qtype) { - struct f2fs_sb_info *sbi = F2FS_SB(sb); + struct super_block *sb = sbi->sb; if (sb_any_quota_loaded(sb) && F2FS_OPTION(sbi).s_qf_names[qtype]) { f2fs_err(sbi, "Cannot change journaled quota options when quota turned on"); @@ -931,32 +931,32 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount) set_opt(sbi, PRJQUOTA); break; case Opt_usrjquota: - ret = f2fs_set_qf_name(sb, USRQUOTA, &args[0]); + ret = f2fs_set_qf_name(sbi, USRQUOTA, &args[0]); if (ret) return ret; break; case Opt_grpjquota: - ret = f2fs_set_qf_name(sb, GRPQUOTA, &args[0]); + ret = f2fs_set_qf_name(sbi, GRPQUOTA, &args[0]); if (ret) return ret; break; case Opt_prjjquota: - ret = f2fs_set_qf_name(sb, PRJQUOTA, &args[0]); + ret = f2fs_set_qf_name(sbi, PRJQUOTA, &args[0]); if (ret) return ret; break; case Opt_offusrjquota: - ret = f2fs_clear_qf_name(sb, USRQUOTA); + ret = f2fs_clear_qf_name(sbi, USRQUOTA); if (ret) return ret; break; case Opt_offgrpjquota: - ret = f2fs_clear_qf_name(sb, GRPQUOTA); + ret = f2fs_clear_qf_name(sbi, GRPQUOTA); if (ret) return ret; break; case Opt_offprjjquota: - ret = f2fs_clear_qf_name(sb, PRJQUOTA); + ret = f2fs_clear_qf_name(sbi, PRJQUOTA); if (ret) return ret; break; From patchwork Mon Mar 3 17:12:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 13999301 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1556EC282D2 for ; Mon, 3 Mar 2025 17:21:58 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tp9UL-0007ei-R7; Mon, 03 Mar 2025 17:21:57 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tp9UK-0007eW-99 for linux-f2fs-devel@lists.sourceforge.net; Mon, 03 Mar 2025 17:21:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=content-type:Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=q6tarKB1CfAIuXjfEy4x7dyKjThyUG3IiqyL5hoH5MY=; b=IcNCVREQqtvIhVIK1HNBONZZCz Zrjjzyci0CAZE7gznZoTv+rfzojg2IaBoDtWqP6423LG+7iWwVZwpszXeG7jhNx5pFZhF9WxyZosv Jr3oxq6GrkDSaQ5Jv7wOCwObSpGokxeaFDDIHo2PKezlFWObfniWcARhr2m3rxLE1zOY=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=content-type:Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=q6tarKB1CfAIuXjfEy4x7dyKjThyUG3IiqyL5hoH5MY=; b=dbSuLtS8SLLjGo5PcvQTE+qnRq 3dPHgTHT+B0ZwZyTMlVC1zNmixKdFtlSIO61MgMOnDcKYuv6nVzOH5WABZFPT6m9ecM0z+LGjwg+a K1+ePpY5UzGVi/4sXyfJxsBscm9HMEFWN4LBr4OwhRbcn8nbVWEk9w14oQ0aszLu25O8=; Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1tp9UD-0008QS-V7 for linux-f2fs-devel@lists.sourceforge.net; Mon, 03 Mar 2025 17:21:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741022504; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=q6tarKB1CfAIuXjfEy4x7dyKjThyUG3IiqyL5hoH5MY=; b=Z9sF1C27Dt9BNcwIj4ON41HV6+kojz5DcO670aJFcYswJn1AdWksDXeR+V+IfpgfE+7O07 zxB+dF9d8vejQKAGmSHd/d7lelsHe2e9Jw7K3JhFqVPQpvIlgFHL6h3ux7GWN+dZ+HkQN8 t16rqqsqbbJVAPLtSECZg9BKM75EPog= Received: from mail-io1-f69.google.com (mail-io1-f69.google.com [209.85.166.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-387-1tFF64RhNT6QuwOtJrRxVA-1; Mon, 03 Mar 2025 12:21:43 -0500 X-MC-Unique: 1tFF64RhNT6QuwOtJrRxVA-1 X-Mimecast-MFC-AGG-ID: 1tFF64RhNT6QuwOtJrRxVA_1741022502 Received: by mail-io1-f69.google.com with SMTP id ca18e2360f4ac-85ad875acccso316021639f.3 for ; Mon, 03 Mar 2025 09:21:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741022502; x=1741627302; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=q6tarKB1CfAIuXjfEy4x7dyKjThyUG3IiqyL5hoH5MY=; b=v2PqF+bSVO8mTo9WKHuSfh0+AhcEsyItZ3S9kiJbALX1TKgXwyo5TyZJeUZRrOHSO5 X7z9k8+Pos5jgr4dLpb5XQRkuJRxus93btyHfQGhRJHR47EWbfeYyfwL92zglquXusJH ZuiD0ZdRubS4KOmGmKErl3vIF5cs7/8vTvWvA3D2gLqvXY7r9vy8nysPX+/GEvV9/4ww 2bjKgnNsTkaMH02XtT7K7UkAneFS2mZbWnEWDcPISKulcYJLkrm1O8WLYf3a+6ic+wAh +q6vtLwpPczUP+bVnRGrKtxmVOCgy/2noI80uMIa732enQgBOPDY3U79lM3ZDzLZW1r0 UUOQ== X-Gm-Message-State: AOJu0YwyFsSxm4+j9pa+os3e7thyrsZv85XM3v77suk46GGtYeSr6wE1 t+LiVb18jiYo/Ub9etUMI7tIn8YgdKLIyyEDW3a0rGkvH8e2OjcEjQI88ITcpItZlh6Xywfow86 aR6jj89/thWm5ClL0gO+N/DRtYZCsUy7ipUuY7sKmhtPenS1gw5gAnOJ0HBvw6HcWdYukWijNx7 +K5ePuci0jFHLz++YDbdbbLcjOM4Q4etd3Z0rNOPmkgps6uqAtSf7nTbbZfw== X-Gm-Gg: ASbGncvQxWr8kxqVkg9uCu0L+eT/mB5BIGZsWW+CGCxFTcFsbnRqr40XXRqmXu+/w6K wNz67bAOOTMcIKmBam3raV7aS/9tS8U9IOFOYDdxQ4nCFsUllnKYGTLkmgqvrV4VA9BT9FqoS+n Cv+P52aCA4qLnnCIm5Wji0cz47IYJQ9IaCo0bMq1+oiE64yyd4BClpLyGoaU4EvAZzgHJupkjZe K//WRXYGenWI5VNu2STnlKSWFwjNI5Th8zfI4+mMDOV/Z5gHkOOt0Id5vHW6t0zXOtrEtehDLEv An7WOxQSwDpdlhp4Mj22UnHgf6uVSF4= X-Received: by 2002:a05:6602:3a82:b0:85a:e7c4:f6b9 with SMTP id ca18e2360f4ac-85ae7c4f81amr265636539f.9.1741022501862; Mon, 03 Mar 2025 09:21:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IHzrP/3MrFLUly11d4J7+M3FYe3B7Z4Sa8O1Ri1DRSKiJhgxCF8L6Y5elLPDbGRaUwqgULqnA== X-Received: by 2002:a05:6602:3a82:b0:85a:e7c4:f6b9 with SMTP id ca18e2360f4ac-85ae7c4f81amr265633139f.9.1741022501513; Mon, 03 Mar 2025 09:21:41 -0800 (PST) Received: from fedora-rawhide.sandeen.net ([65.128.97.82]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-85add261b4csm49563939f.9.2025.03.03.09.21.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Mar 2025 09:21:40 -0800 (PST) From: Eric Sandeen To: linux-f2fs-devel@lists.sourceforge.net Date: Mon, 3 Mar 2025 11:12:19 -0600 Message-ID: <20250303172127.298602-10-sandeen@redhat.com> X-Mailer: git-send-email 2.48.0 In-Reply-To: <20250303172127.298602-1-sandeen@redhat.com> References: <20250303172127.298602-1-sandeen@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: AhXmwcrQ5U__zTlHt3wk7CrY-LLlZG56ucxsA8fBGjs_1741022502 X-Mimecast-Originator: redhat.com X-Headers-End: 1tp9UD-0008QS-V7 Subject: [f2fs-dev] [PATCH 9/9] f2fs: pass sbi rather than sb to parse_options() X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jaegeuk@kernel.org, lihongbo22@huawei.com, Eric Sandeen Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net With the new mount API the sb will not be available during initial option parsing, which will happen before fill_super reads sb from disk. Now that the sb is no longer directly referenced in parse_options, switch it to use sbi. (Note that all calls to f2fs_sb_has_* originating from parse_options will need to be deferred to later before we can use the new mount API.) Signed-off-by: Eric Sandeen Reviewed-by: Chao Yu --- fs/f2fs/super.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 9edb200caae7..579c96a80fe2 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -670,9 +670,8 @@ static int f2fs_set_zstd_level(struct f2fs_sb_info *sbi, const char *str) #endif #endif -static int parse_options(struct super_block *sb, char *options, bool is_remount) +static int parse_options(struct f2fs_sb_info *sbi, char *options, bool is_remount) { - struct f2fs_sb_info *sbi = F2FS_SB(sb); substring_t args[MAX_OPT_ARGS]; #ifdef CONFIG_F2FS_FS_COMPRESSION unsigned char (*ext)[F2FS_EXTENSION_LEN]; @@ -2356,7 +2355,7 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data) default_options(sbi, true); /* parse mount options */ - err = parse_options(sb, data, true); + err = parse_options(sbi, data, true); if (err) goto restore_opts; @@ -4496,7 +4495,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) goto free_sb_buf; } - err = parse_options(sb, options, false); + err = parse_options(sbi, options, false); if (err) goto free_options;