* [f2fs-dev] [PATCH v2] f2fs: quota: fix stale lock holder on remount failure
@ 2026-09-09 11:46 Jianan Huang
2026-09-09 12:07 ` Chao Yu via Linux-f2fs-devel
2026-09-14 15:30 ` patchwork-bot+f2fs--- via Linux-f2fs-devel
0 siblings, 2 replies; 3+ messages in thread
From: Jianan Huang @ 2026-09-09 11:46 UTC (permalink / raw)
To: linux-f2fs-devel, chao, jaegeuk; +Cc: Jianan Huang
F2FS remount can fail while duplicating a journalled quota file name.
f2fs_remount()
- sbi->umount_lock_holder = current
- kstrdup(F2FS_OPTION(sbi).s_qf_names[i])
: fails
- free previously duplicated names
- return -ENOMEM
The direct return leaves umount_lock_holder pointing at the failed
remount context. A later checkpoint may then wrongly treat another
context as the s_umount lock holder.
Add a restore_holder cleanup path and use it before returning -ENOMEM.
Fixes: eb85c2410d6f ("f2fs: quota: fix to avoid warning in dquot_writeback_dquots()")
Signed-off-by: Jianan Huang <jnhuang95@gmail.com>
---
Changes since v1:
- add restore_holder cleanup label.
fs/f2fs/super.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 1314b6ccced9..867c82192078 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -2864,7 +2864,8 @@ static int __f2fs_remount(struct fs_context *fc, struct super_block *sb)
if (!org_mount_opt.s_qf_names[i]) {
for (j = 0; j < i; j++)
kfree(org_mount_opt.s_qf_names[j]);
- return -ENOMEM;
+ err = -ENOMEM;
+ goto restore_holder;
}
} else {
org_mount_opt.s_qf_names[i] = NULL;
@@ -3125,6 +3126,7 @@ static int __f2fs_remount(struct fs_context *fc, struct super_block *sb)
sbi->mount_opt = org_mount_opt;
sb->s_flags = old_sb_flags;
+restore_holder:
sbi->umount_lock_holder = NULL;
return err;
}
--
2.43.0
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [f2fs-dev] [PATCH v2] f2fs: quota: fix stale lock holder on remount failure
2026-09-09 11:46 [f2fs-dev] [PATCH v2] f2fs: quota: fix stale lock holder on remount failure Jianan Huang
@ 2026-09-09 12:07 ` Chao Yu via Linux-f2fs-devel
2026-09-14 15:30 ` patchwork-bot+f2fs--- via Linux-f2fs-devel
1 sibling, 0 replies; 3+ messages in thread
From: Chao Yu via Linux-f2fs-devel @ 2026-09-09 12:07 UTC (permalink / raw)
To: Jianan Huang, linux-f2fs-devel, jaegeuk
On 9/9/26 19:46, Jianan Huang wrote:
> F2FS remount can fail while duplicating a journalled quota file name.
>
> f2fs_remount()
> - sbi->umount_lock_holder = current
> - kstrdup(F2FS_OPTION(sbi).s_qf_names[i])
> : fails
> - free previously duplicated names
> - return -ENOMEM
>
> The direct return leaves umount_lock_holder pointing at the failed
> remount context. A later checkpoint may then wrongly treat another
> context as the s_umount lock holder.
>
> Add a restore_holder cleanup path and use it before returning -ENOMEM.
>
> Fixes: eb85c2410d6f ("f2fs: quota: fix to avoid warning in dquot_writeback_dquots()")
> Signed-off-by: Jianan Huang <jnhuang95@gmail.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Thanks,
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [f2fs-dev] [PATCH v2] f2fs: quota: fix stale lock holder on remount failure
2026-09-09 11:46 [f2fs-dev] [PATCH v2] f2fs: quota: fix stale lock holder on remount failure Jianan Huang
2026-09-09 12:07 ` Chao Yu via Linux-f2fs-devel
@ 2026-09-14 15:30 ` patchwork-bot+f2fs--- via Linux-f2fs-devel
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+f2fs--- via Linux-f2fs-devel @ 2026-09-14 15:30 UTC (permalink / raw)
To: Jianan Huang; +Cc: jaegeuk, linux-f2fs-devel
Hello:
This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <jaegeuk@kernel.org>:
On Wed, 9 Sep 2026 19:46:14 +0800 you wrote:
> F2FS remount can fail while duplicating a journalled quota file name.
>
> f2fs_remount()
> - sbi->umount_lock_holder = current
> - kstrdup(F2FS_OPTION(sbi).s_qf_names[i])
> : fails
> - free previously duplicated names
> - return -ENOMEM
>
> [...]
Here is the summary with links:
- [f2fs-dev,v2] f2fs: quota: fix stale lock holder on remount failure
https://git.kernel.org/jaegeuk/f2fs/c/3f140a60c92a
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-09-14 15:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-09 11:46 [f2fs-dev] [PATCH v2] f2fs: quota: fix stale lock holder on remount failure Jianan Huang
2026-09-09 12:07 ` Chao Yu via Linux-f2fs-devel
2026-09-14 15:30 ` patchwork-bot+f2fs--- via Linux-f2fs-devel
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.