mirror of
https://github.com/nilfs-dev/nilfs-utils.git
synced 2026-01-26 13:43:15 +00:00
mount.nilfs2: fix ignored error on remount target mismatch
In nilfs_prepare_mount(), when a rw->rw remount is attempted on a different mount point, an error message is printed, but the function fails to abort the process. This occurs because the return variable 'res' remains 0 (success) when jumping to the failure label. While a regular mount would eventually fail in the system call, a fake mount (-f) skips the system call and would incorrectly succeed with exit code 0 despite the error. Fix this by setting 'res' to -EINVAL. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
This commit is contained in:
parent
53a23b7069
commit
d189cfcf5c
@ -358,6 +358,7 @@ static int nilfs_prepare_mount(struct nilfs_mount_info *mi)
|
||||
mnt_table_get_cache(mtab))) {
|
||||
error(_("%s: different mount point (%s). remount failed."),
|
||||
progname, mnt_context_get_target(cxt));
|
||||
res = -EINVAL;
|
||||
goto failed;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user