mirror of
https://github.com/systemd/systemd.git
synced 2026-11-06 05:17:24 +00:00
shutdown: propagate correct error when remounting fails
Here the logging was fine, but the bogus r == -1 value was propagated as the return value. The parent then logged "Remounting '…' failed abnormally, child process … failed: Operation not permitted" whatever the real error was, and returned -EPERM. Do what umount_with_timeout() already does with umount2(). (cherry picked from commit8087660ccc) (cherry picked from commit3e9368f0e9)
This commit is contained in:
1 parent
87c4028d8a
commit
c365aa1ddf
1 file changed
+2
-2
@@ -273,10 +273,10 @@ static int remount_with_timeout(MountPoint *m, bool last_try) {
|
||||
log_info("Remounting '%s' read-only with options '%s'.", m->path, strempty(m->remount_options));
|
||||
|
||||
/* Start the mount operation here in the child */
|
||||
r = mount(NULL, m->path, NULL, m->remount_flags, m->remount_options);
|
||||
r = RET_NERRNO(mount(/* source= */ NULL, m->path, /* filesystemtype= */ NULL, m->remount_flags, m->remount_options));
|
||||
if (r < 0)
|
||||
log_full_errno(last_try ? LOG_ERR : LOG_INFO,
|
||||
errno,
|
||||
r,
|
||||
"Failed to remount '%s' read-only: %m",
|
||||
m->path);
|
||||
|
||||
|
||||
Reference in new issue
Block a user