]> git.itanic.dy.fi Git - linux-stable/commit
ext4: improve error recovery code paths in __ext4_remount()
authorTheodore Ts'o <tytso@mit.edu>
Sat, 6 May 2023 02:20:29 +0000 (22:20 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 13 May 2023 22:05:05 +0000 (18:05 -0400)
commit4c0b4818b1f636bc96359f7817a2d8bab6370162
treefab933e7b6fadc2a7c08b70718704416fd96da04
parent4b3cb1d108bfc2aebb0d7c8a52261a53cf7f5786
ext4: improve error recovery code paths in __ext4_remount()

If there are failures while changing the mount options in
__ext4_remount(), we need to restore the old mount options.

This commit fixes two problem.  The first is there is a chance that we
will free the old quota file names before a potential failure leading
to a use-after-free.  The second problem addressed in this commit is
if there is a failed read/write to read-only transition, if the quota
has already been suspended, we need to renable quota handling.

Cc: stable@kernel.org
Link: https://lore.kernel.org/r/20230506142419.984260-2-tytso@mit.edu
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/super.c