mirror of
https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
synced 2024-12-03 23:14:53 +08:00
e2fsck: zero ctx->fs after freeing fs when restarting due to MMP
If MMP is enabled and e2fsck determines that it needs to restart itself on account of various MMP conditions, it will close the current fs and jump back to the start of fs checking. However, closing fs also frees it, which means that we need to set ctx->fs to NULL to prevent subsequent open code from accessing the old deleted pointer. Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This commit is contained in:
parent
a7a63675af
commit
1660034c0a
@ -1352,6 +1352,7 @@ failure:
|
||||
*/
|
||||
if (flags & EXT2_FLAG_SKIP_MMP) {
|
||||
ext2fs_close(fs);
|
||||
ctx->fs = NULL;
|
||||
flags &= ~EXT2_FLAG_SKIP_MMP;
|
||||
goto restart;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user