pid1: improve logging when failing to remount / ro (#5940)
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 11 May 2017 16:12:41 +0000 (12:12 -0400)
committerLennart Poettering <lennart@poettering.net>
Thu, 11 May 2017 16:12:41 +0000 (18:12 +0200)
commitc826cd3f7cfd950c8a86d57dfa6303f70de3e207
tree261dacd92fb165e6cbf5634fff0fb7125197d9f1
parentf5938e8ff3cf5b6fadd6b440b3b10fc0e5a64733
pid1: improve logging when failing to remount / ro (#5940)

https://bugzilla.redhat.com/show_bug.cgi?id=1227736#c49

We counted how many filesystems could not be unmounted, but only for those
filesystems which we tried to unmount. Since we only remount / ro, without
attempting to unmount, we would emit a confusing error message:

Remounting '/' read-only with options 'seclabel,space_cache,subvolid=5,subvol=/'.
Remounting '/' read-only with options 'seclabel,space_cache,subvolid=5,subvol=/'.
Remounting '/' read-only with options 'seclabel,space_cache,subvolid=5,subvol=/'.
All filesystems unmounted.

Warn when remount-ro fails, and for filesystems which we won't try to unmount,
include the failure to remount-ro in n_failed.

A few minor cleanups:
- remove unecessary goto which jumps to the next line anyway
- always calculate n_failed, even if log_error is false. This causes no change
  in behaviour, but I think the code is easier to follow, since the log setting
  cannot influence other logic.
src/core/umount.c