From mboxrd@z Thu Jan 1 00:00:00 1970 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 42DACD743D8 for ; Wed, 20 Nov 2024 20:39:06 +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 1tDrTc-0002T3-0c; Wed, 20 Nov 2024 20:39:04 +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 1tDrTZ-0002Sq-U7 for linux-f2fs-devel@lists.sourceforge.net; Wed, 20 Nov 2024 20:39:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: 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=G+NzlgtzQdHsAAU8uYhLAEYIWuj/9dRqo6Ex7/fbRCA=; b=mHSAVyVcv3utIECtztgdfpdY4c dFG+xuQQ2Jd9VOERuUr0ND1QkJswQp4+FOrqwIzr4Bq0my0H6IzjBTv3PqZ1Fw4inlkPVQoGSyZu9 LDYr/u6bwiK3QIc0xyrRAU9OyV58GhJKxsH/ja86QMgyXOYOpb2wAh65ZUiQFCYlimqc=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding: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=G+NzlgtzQdHsAAU8uYhLAEYIWuj/9dRqo6Ex7/fbRCA=; b=gYU/SkQdeto/YW9yvZdw/9ZAKH aaiVVf0DXvlImXl2vh6CByq0ZyvGXOgSWPTtGP2dNuKy50cEIawDgeYC0qF8UGYebOqqdMkXhp0mK yKXIrWbnioNxGjZHLHfe43pzn7k/Zo1eMeqV+EmcObvH6uWOggwebYHz8THLrJTVttxI=; Received: from nyc.source.kernel.org ([147.75.193.91]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1tDrTZ-0008Qf-Pv for linux-f2fs-devel@lists.sourceforge.net; Wed, 20 Nov 2024 20:39:02 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id B086AA4336E; Wed, 20 Nov 2024 20:36:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D101C4CECD; Wed, 20 Nov 2024 20:38:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732135130; bh=+5Y0qbRrViO3GMeurt2tZfKhhx1FHV6cNAsoCq4C07w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IXGfixLDpaBgzbUue1q95L/wK0RSea9FMEURCrOLwHxHR7iZdh34rm4yYYgGdfmAL 4+HqG3pplXhytnRXBMGafoF6zW959Z7RBGNRv3+MvMkFjXYXhtiQf57SQloD3asaqL MbbMbBGfI8mW44Yt5Cf0IRiz6VU+j7t+Pfjj2KRoJmF/BHwizj1+t9zryGa57oddUa DA5lKcjwOecpHQj94QHePoQIbAfXBC12bTayISHLcEqVxy4R3iAZmCwnBv7rMmO/Ex bHv2n1htZhUEZQkyhRCCvtCAKoxrb4E2bUBeVU44uXWeHIli4dqVwMDkqNLf/sLXog n+/G9WMZC5K1w== Date: Wed, 20 Nov 2024 20:38:49 +0000 To: Eric Sandeen Message-ID: References: <20241112010820.2788822-1-jaegeuk@kernel.org> <493ce255-efcd-48af-ad7f-6e421cc04f1c@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Headers-End: 1tDrTZ-0008Qf-Pv Subject: Re: [f2fs-dev] [PATCH] Revert "f2fs: remove unreachable lazytime mount 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: , From: Jaegeuk Kim via Linux-f2fs-devel Reply-To: Jaegeuk Kim Cc: Daniel Rosenberg , linux-kernel@vger.kernel.org, stable@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On 11/20, Eric Sandeen wrote: > On 11/20/24 8:27 AM, Eric Sandeen wrote: > > On 11/12/24 3:39 PM, Jaegeuk Kim wrote: > >> Hi Eric, > >> > >> Could you please check this revert as it breaks the mount()? > >> It seems F2FS needs to implement new mount support. > >> > >> Thanks, > > > > I'm sorry, I missed this email. I will look into it more today. > > Ok, I see that I had not considered a direct mount call passing > the lazytime option strings. :( > > Using mount(8), "lazytime" is never passed as an option all the way to f2fs, > nor is "nolazytime" - > > # mount -o loop,nolazytime f2fsfile.img mnt > # mount | grep lazytime > /root/f2fs-test/f2fsfile.img on /root/f2fs-test/mnt type f2fs (rw,relatime,lazytime,seclabel,background_gc=on,nogc_merge,discard,discard_unit=block,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,barrier,extent_cache,mode=adaptive,active_logs=6,alloc_mode=reuse,checkpoint_merge,fsync_mode=posix,memory=normal,errors=continue) > > (note that lazytime is still set despite -o nolazytime) > > when mount(8) is using the new mount API, it does do fsconfig for (no)lazytime: > > fsconfig(3, FSCONFIG_SET_FLAG, "nolazytime", NULL, 0) = 0 > > but that is consumed by the VFS and never sent into f2fs for parsing. > > And because default_options() does: > > sbi->sb->s_flags |= SB_LAZYTIME; > > by default, it overrides the "nolazytime" that the vfs had previously handled. > > I'm fairly sure that when mount(8) was using the old mount API (long ago) it also > did not send in the lazytime option string - it sent it as a flag instead. > > However - a direct call to mount(2) /will/ pass those options all the way > to f2fs, and parse_options() does need to handle them there or it will be rejected > as an invalid option. > > (Note that f2fs is the only filesystem that attempts to handle lazytime within > the filesystem itself): > > [linux]# grep -r \"lazytime\" fs/*/ > fs/f2fs/super.c: {Opt_lazytime, "lazytime"}, > [linux]# > > I'm not entirely sure how to untangle all this, but regressions are not acceptable, > so please revert my commit for now. Thanks for the explanation. At a glance, I thought it's caused that f2fs doesn't implement fs_context_operations. We'll take a look at how to support it. > > Thanks, > -Eric > > > > As for f2fs new mount API support, I have been struggling with it for a > > long time, f2fs has been uniquely complex. The assumption that the superblock > > and on-disk features are known at option parsing time makes it much more > > difficult than most other filesystems. > > > > But if there's a problem/regression with this commit, I have no objection to > > reverting the commit for now, and I'm sorry for the error. > > > > -Eric > > > >> On 11/12, Jaegeuk Kim wrote: > >>> This reverts commit 54f43a10fa257ad4af02a1d157fefef6ebcfa7dc. > >>> > >>> The above commit broke the lazytime mount, given > >>> > >>> mount("/dev/vdb", "/mnt/test", "f2fs", 0, "lazytime"); > >>> > >>> CC: stable@vger.kernel.org # 6.11+ > >>> Signed-off-by: Daniel Rosenberg > >>> Signed-off-by: Jaegeuk Kim > >>> --- > >>> fs/f2fs/super.c | 10 ++++++++++ > >>> 1 file changed, 10 insertions(+) > >>> > >>> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c > >>> index 49519439b770..35c4394e4fc6 100644 > >>> --- a/fs/f2fs/super.c > >>> +++ b/fs/f2fs/super.c > >>> @@ -150,6 +150,8 @@ enum { > >>> Opt_mode, > >>> Opt_fault_injection, > >>> Opt_fault_type, > >>> + Opt_lazytime, > >>> + Opt_nolazytime, > >>> Opt_quota, > >>> Opt_noquota, > >>> Opt_usrquota, > >>> @@ -226,6 +228,8 @@ static match_table_t f2fs_tokens = { > >>> {Opt_mode, "mode=%s"}, > >>> {Opt_fault_injection, "fault_injection=%u"}, > >>> {Opt_fault_type, "fault_type=%u"}, > >>> + {Opt_lazytime, "lazytime"}, > >>> + {Opt_nolazytime, "nolazytime"}, > >>> {Opt_quota, "quota"}, > >>> {Opt_noquota, "noquota"}, > >>> {Opt_usrquota, "usrquota"}, > >>> @@ -922,6 +926,12 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount) > >>> f2fs_info(sbi, "fault_type options not supported"); > >>> break; > >>> #endif > >>> + case Opt_lazytime: > >>> + sb->s_flags |= SB_LAZYTIME; > >>> + break; > >>> + case Opt_nolazytime: > >>> + sb->s_flags &= ~SB_LAZYTIME; > >>> + break; > >>> #ifdef CONFIG_QUOTA > >>> case Opt_quota: > >>> case Opt_usrquota: > >>> -- > >>> 2.47.0.277.g8800431eea-goog > >> > > _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E4C972F2A; Wed, 20 Nov 2024 20:38:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732135131; cv=none; b=aCTjGWnhQ9z9SHencOaFtOzsIm9EhpyE0kQPWzWUjsLKHwmmAxkLeO3K7dP6xGgPMsSxOhtsWZSJROOp8W/yayujz64Oq0i037GEWEnmXvt1xnGzYv4iBfrZn1k9oBKBgvpMULRImpOsO9GAesDmn6T4JU/XXXQI1dhIjIJpK+0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732135131; c=relaxed/simple; bh=+5Y0qbRrViO3GMeurt2tZfKhhx1FHV6cNAsoCq4C07w=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gKUMUITYS/lCPgbBnfkTQgsk/Y0nG/CyBqbgjvoTtClazdVoxLrBgAxmMiTtX4xjnNL853FUf1dw81/s3My55KNL+S5lLlvlOxbLI/pCmZ2OBk2l4Old9rvuKKc+BHGru4ir95cLfskMtgmo/HXlwSBu7WpavgsBK3rVAIW1feQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IXGfixLD; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IXGfixLD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D101C4CECD; Wed, 20 Nov 2024 20:38:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732135130; bh=+5Y0qbRrViO3GMeurt2tZfKhhx1FHV6cNAsoCq4C07w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IXGfixLDpaBgzbUue1q95L/wK0RSea9FMEURCrOLwHxHR7iZdh34rm4yYYgGdfmAL 4+HqG3pplXhytnRXBMGafoF6zW959Z7RBGNRv3+MvMkFjXYXhtiQf57SQloD3asaqL MbbMbBGfI8mW44Yt5Cf0IRiz6VU+j7t+Pfjj2KRoJmF/BHwizj1+t9zryGa57oddUa DA5lKcjwOecpHQj94QHePoQIbAfXBC12bTayISHLcEqVxy4R3iAZmCwnBv7rMmO/Ex bHv2n1htZhUEZQkyhRCCvtCAKoxrb4E2bUBeVU44uXWeHIli4dqVwMDkqNLf/sLXog n+/G9WMZC5K1w== Date: Wed, 20 Nov 2024 20:38:49 +0000 From: Jaegeuk Kim To: Eric Sandeen Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, stable@vger.kernel.org, Daniel Rosenberg Subject: Re: [PATCH] Revert "f2fs: remove unreachable lazytime mount option parsing" Message-ID: References: <20241112010820.2788822-1-jaegeuk@kernel.org> <493ce255-efcd-48af-ad7f-6e421cc04f1c@redhat.com> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On 11/20, Eric Sandeen wrote: > On 11/20/24 8:27 AM, Eric Sandeen wrote: > > On 11/12/24 3:39 PM, Jaegeuk Kim wrote: > >> Hi Eric, > >> > >> Could you please check this revert as it breaks the mount()? > >> It seems F2FS needs to implement new mount support. > >> > >> Thanks, > > > > I'm sorry, I missed this email. I will look into it more today. > > Ok, I see that I had not considered a direct mount call passing > the lazytime option strings. :( > > Using mount(8), "lazytime" is never passed as an option all the way to f2fs, > nor is "nolazytime" - > > # mount -o loop,nolazytime f2fsfile.img mnt > # mount | grep lazytime > /root/f2fs-test/f2fsfile.img on /root/f2fs-test/mnt type f2fs (rw,relatime,lazytime,seclabel,background_gc=on,nogc_merge,discard,discard_unit=block,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,barrier,extent_cache,mode=adaptive,active_logs=6,alloc_mode=reuse,checkpoint_merge,fsync_mode=posix,memory=normal,errors=continue) > > (note that lazytime is still set despite -o nolazytime) > > when mount(8) is using the new mount API, it does do fsconfig for (no)lazytime: > > fsconfig(3, FSCONFIG_SET_FLAG, "nolazytime", NULL, 0) = 0 > > but that is consumed by the VFS and never sent into f2fs for parsing. > > And because default_options() does: > > sbi->sb->s_flags |= SB_LAZYTIME; > > by default, it overrides the "nolazytime" that the vfs had previously handled. > > I'm fairly sure that when mount(8) was using the old mount API (long ago) it also > did not send in the lazytime option string - it sent it as a flag instead. > > However - a direct call to mount(2) /will/ pass those options all the way > to f2fs, and parse_options() does need to handle them there or it will be rejected > as an invalid option. > > (Note that f2fs is the only filesystem that attempts to handle lazytime within > the filesystem itself): > > [linux]# grep -r \"lazytime\" fs/*/ > fs/f2fs/super.c: {Opt_lazytime, "lazytime"}, > [linux]# > > I'm not entirely sure how to untangle all this, but regressions are not acceptable, > so please revert my commit for now. Thanks for the explanation. At a glance, I thought it's caused that f2fs doesn't implement fs_context_operations. We'll take a look at how to support it. > > Thanks, > -Eric > > > > As for f2fs new mount API support, I have been struggling with it for a > > long time, f2fs has been uniquely complex. The assumption that the superblock > > and on-disk features are known at option parsing time makes it much more > > difficult than most other filesystems. > > > > But if there's a problem/regression with this commit, I have no objection to > > reverting the commit for now, and I'm sorry for the error. > > > > -Eric > > > >> On 11/12, Jaegeuk Kim wrote: > >>> This reverts commit 54f43a10fa257ad4af02a1d157fefef6ebcfa7dc. > >>> > >>> The above commit broke the lazytime mount, given > >>> > >>> mount("/dev/vdb", "/mnt/test", "f2fs", 0, "lazytime"); > >>> > >>> CC: stable@vger.kernel.org # 6.11+ > >>> Signed-off-by: Daniel Rosenberg > >>> Signed-off-by: Jaegeuk Kim > >>> --- > >>> fs/f2fs/super.c | 10 ++++++++++ > >>> 1 file changed, 10 insertions(+) > >>> > >>> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c > >>> index 49519439b770..35c4394e4fc6 100644 > >>> --- a/fs/f2fs/super.c > >>> +++ b/fs/f2fs/super.c > >>> @@ -150,6 +150,8 @@ enum { > >>> Opt_mode, > >>> Opt_fault_injection, > >>> Opt_fault_type, > >>> + Opt_lazytime, > >>> + Opt_nolazytime, > >>> Opt_quota, > >>> Opt_noquota, > >>> Opt_usrquota, > >>> @@ -226,6 +228,8 @@ static match_table_t f2fs_tokens = { > >>> {Opt_mode, "mode=%s"}, > >>> {Opt_fault_injection, "fault_injection=%u"}, > >>> {Opt_fault_type, "fault_type=%u"}, > >>> + {Opt_lazytime, "lazytime"}, > >>> + {Opt_nolazytime, "nolazytime"}, > >>> {Opt_quota, "quota"}, > >>> {Opt_noquota, "noquota"}, > >>> {Opt_usrquota, "usrquota"}, > >>> @@ -922,6 +926,12 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount) > >>> f2fs_info(sbi, "fault_type options not supported"); > >>> break; > >>> #endif > >>> + case Opt_lazytime: > >>> + sb->s_flags |= SB_LAZYTIME; > >>> + break; > >>> + case Opt_nolazytime: > >>> + sb->s_flags &= ~SB_LAZYTIME; > >>> + break; > >>> #ifdef CONFIG_QUOTA > >>> case Opt_quota: > >>> case Opt_usrquota: > >>> -- > >>> 2.47.0.277.g8800431eea-goog > >> > >