The recent code cleanup of __ext4_fill_super() resulted in a bug reported by Syzkaller. When I investigated this issue, I found that the bug was caused by a fragile and partially redundant way error codes were set to be returned by the __ext4_fill_super() function. The first patch fixes the bug found by Syzkaller, and the second and third patch cleans up the error handling in __ext4_fill_super() and __ext4_multi_mount_protect(). Andreas, please take a look at the second patch, as it changes the error codes returned in various cases when the MMP feature prevents the file system from being mounted and other failure cases. For example, when another system has the file system mounted, mount will now return EBUSY instead EINVAL. In other cases, if a memory allocation fails, mount will now return ENOMEM instead of EINVAL. I think this is an improvement, but there might be some userspace code that might get confused by this. Since Lustre users tend to be most common users of the MMP feature, I'd appreciate your review of this patch. Theodore Ts'o (3): ext4: fix lost error code reporting in __ext4_fill_super() ext4: reflect error codes from ext4_multi_mount_protect() to its callers ext4: clean up error handling in __ext4_fill_super() fs/ext4/mmp.c | 9 ++++++- fs/ext4/super.c | 68 +++++++++++++++++++++++++++++-------------------- 2 files changed, 48 insertions(+), 29 deletions(-) -- 2.31.0