Patch "f2fs: defer readonly check vs norecovery" has been added to the 6.14-stable tree
Quoted 7 lines · Sasha Levin
This is a note to let you know that I've just added the patch titled
f2fs: defer readonly check vs norecovery
to the 6.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
Quoted 6 lines
The filename of the patch is:
f2fs-defer-readonly-check-vs-norecovery.patch
and it can be found in the queue-6.14 subdirectory.If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
I already replied to the AUTOSEL email on 5/5 saying that this is not a bug fix and should not be in the stable tree, but here we are.
Quoted 50 lines
commit
442e4090bb78d5dce4506a591214ce2447d6ea50Author: Eric Sandeen <[email protected]> Date: Mon Mar 3 11:12:17 2025 -0600f2fs: defer readonly check vs norecovery
[ Upstream commit
9cca49875997a1a7e92800a828a62bacb0f577b9]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 <[email protected]>Reviewed-by Chao Yu <[email protected]>Signed-off-by Jaegeuk Kim <[email protected]>Signed-off-by Sasha Levin <[email protected]>fs/f2fs/super.c +7
-3@@ -728,10 +728,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)) {@@ -1418,6 +1416,12 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)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 ; }