summaryrefslogtreecommitdiff
path: root/src/core/umount.c
AgeCommit message (Collapse)Author
2016-05-25stuffLuke Shumaker
2016-02-10tree-wide: remove Emacs lines from all filesDaniel Mack
This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
2015-11-17tree-wide: group include of libudev.h with sd-*Thomas Hindoe Paaboel Andersen
2015-11-16tree-wide: sort includesThomas Hindoe Paaboel Andersen
Sort the includes accoding to the new coding style.
2015-10-27util-lib: split out allocation calls into alloc-util.[ch]Lennart Poettering
2015-10-26unmount: Pass in mount options when remounting read-onlyJan Janssen
man 2 mount says that the mountflags and data parameteres should match the original values except for the desired changes. We only bother with the mount options since the only flags we can change are MS_RDONLY, MS_SYNCHRONOUS and MS_MANDLOCK; which shouldn't matter too much. Fixes: #351
2015-10-25util-lib: split out fd-related operations into fd-util.[ch]Lennart Poettering
There are more than enough to deserve their own .c file, hence move them over.
2015-10-24util-lib: split our string related calls from util.[ch] into its own file ↵Lennart Poettering
string-util.[ch] There are more than enough calls doing string manipulations to deserve its own files, hence do something about it. This patch also sorts the #include blocks of all files that needed to be updated, according to the sorting suggestions from CODING_STYLE. Since pretty much every file needs our string manipulation functions this effectively means that most files have sorted #include blocks now. Also touches a few unrelated include files.
2015-10-24util: split out escaping code into escape.[ch]Lennart Poettering
This really deserves its own file, given how much code this is now.
2015-09-07basic: rework virtualization detection APILennart Poettering
Introduce a proper enum, and don't pass around string ids anymore. This simplifies things quite a bit, and makes virtualization detection more similar to architecture detection.
2015-06-12core: fix CID 996302Susant Sahani
CID 996302: Error handling issues (CHECKED_RETURN)
2015-04-07util: rework cunescape(), improve error handlingLennart Poettering
Change cunescape() to return a normal error code, so that we can distuingish OOM errors from parse errors. This also adds a flags parameter to control whether "relaxed" or normal parsing shall be done. If set no parse failures are generated, and the only reason why cunescape() can fail is OOM.
2015-02-23remove unused includesThomas Hindoe Paaboel Andersen
This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
2015-01-23core,shutdown: don't bother with unmounting any mounts below /sys, /proc, ↵Lennart Poettering
/dev when shutting down After all, mounts below these directories are pretty much guaranteed to be virtual, and it's hence unnecessary to unmount them during shutdown. Moreover, in less-priviliged containers we might lack the rights to unmount them, hence don't even try. http://lists.freedesktop.org/archives/systemd-devel/2015-January/027113.html
2014-11-28treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt
If the format string contains %m, clearly errno must have a meaningful value, so we might as well use log_*_errno to have ERRNO= logged. Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/' Plus some whitespace, linewrap, and indent adjustments.
2014-06-24use more _cleanup_ macroRonny Chevalier
2014-06-05umount: modernizationsLennart Poettering
2014-03-18util: replace close_nointr_nofail() by a more useful safe_close()Lennart Poettering
safe_close() automatically becomes a NOP when a negative fd is passed, and returns -1 unconditionally. This makes it easy to write lines like this: fd = safe_close(fd); Which will close an fd if it is open, and reset the fd variable correctly. By making use of this new scheme we can drop a > 200 lines of code that was required to test for non-negative fds or to reset the closed fd variable afterwards.
2014-02-17core: more exact test on the procfs special string "(deleted)"Jan Engelhardt
In other parts of systemd, the code checks for " (deleted)", but in one instance, it did not (yet). Make it do the same.
2013-12-18core,logind: libudev usage modernizationsLennart Poettering
Always use cleanup logic and don't eat up errors returned by libudev
2013-10-14list: make our list macros a bit easier to use by not requring type spec on ↵Lennart Poettering
each invocation We can determine the list entry type via the typeof() gcc construct, and so we should to make the macros much shorter to use.
2013-10-13Introduce udev object cleanup functionsZbigniew Jędrzejewski-Szmek
2013-04-18move _cleanup_ attribute in front of the typeHarald Hoyer
http://lists.freedesktop.org/archives/systemd-devel/2013-April/010510.html
2013-04-15Fix spelling errors using 'codespell' toolAnatol Pomozov
2013-04-05Use initalization instead of explicit zeroingZbigniew Jędrzejewski-Szmek
Before, we would initialize many fields twice: first by filling the structure with zeros, and then a second time with the real values. We can let the compiler do the job for us, avoiding one copy. A downside of this patch is that text gets slightly bigger. This is because all zero() calls are effectively inlined: $ size build/.libs/systemd text data bss dec hex filename before 897737 107300 2560 1007597 f5fed build/.libs/systemd after 897873 107300 2560 1007733 f6075 build/.libs/systemd … actually less than 1‰. A few asserts that the parameter is not null had to be removed. I don't think this changes much, because first, it is quite unlikely for the assert to fail, and second, an immediate SEGV is almost as good as an assert.
2013-03-31ModernizationZbigniew Jędrzejewski-Szmek
Use _cleanup_ and wrap lines to ~80 chars and such.
2013-01-20shutdown: loop - convert to enumerate matchKay Sievers
2013-01-16shutdown: ignore loop devices without a backing fileKay Sievers
2013-01-16shutdown: in the final umount loop don't use MNT_FORCELennart Poettering
MNT_FORCE is honoured by NFS and FUSE and allows unmounting of the FS even if consumers still use it. For our brute-force loop we rely on EBUSY being reported as long as a file system is still used by a loopback device or suchlike. Hence, drop MNT_FORCE to make EBUSY reliable.
2012-12-07shutdown, umount: use verbs consistentlyMichal Schmidt
Mounts are "unmounted". Swaps are "deactivated", not "turned off" nor "disabled". Loop and DM devices are "detached", not "deleted". Especially the deleting sounded a bit scary.
2012-12-07shutdown, umount: logging improvementsMichal Schmidt
In bugreports about hangs during the late shutdown we are often missing important information - what were we trying to unmount/detach when it hung. Instead of printing what we successfully unmounted, print what we are going to unmount/detach. And add messages to mark the completion of categories (mount/swap/loop/DM).
2012-12-07umount: fix check for DM changedMichal Schmidt
delete_dm() returns 0 on success. The check for "r > 0" was likely a copy&paste error from the loopback code where "r > 0" makes sense.
2012-11-28shutdown: fix typoHermann Gausterer
2012-11-28shutdown: don't consider umounting of / and /usr failedTom Gundersen
In the words of Homer: If you don't try, you can't fail. This is a revert of 9279749b84cc87c7830280b7895a48bed03c9429. It used to be necessary to consider the umounting failed to make sure / and /usr were remounted read-only, but that is no longer necessary as everything is now remounted read-only anyway. Moreover, this avoids a warning at shutdown saying a filesystem was not unmounted. As the umounting of / is never attempted there was no corresponding warning message saying which fs that failed. This caused some spurious bug-reports from concerned users. Cc: Michael Biebl <biebl@debian.org>
2012-11-16umount: always remount read-only before unmounting in final shutdown loopLennart Poettering
2012-09-03shutdown: don't attempt read-only mounts in a containerLennart Poettering
2012-08-13umount: MS_MGC_VAL is so 90sLennart Poettering
2012-05-30shutdown: Don't skip bind mounts on shutdownDaniel Drake
This reverts commits d72238fcb34abc81aca97c5fb15888708ee937d3 and f3accc08. OLPC runs / as a bind-mount, so this must be remounted RO during shutdown to avoid corruption. As Lennert can't recall the exact reasons for making the shutdown code skip bind mounts, revert to previous behaviour to solve the issue for OLPC. http://lists.freedesktop.org/archives/systemd-devel/2012-April/004957.html
2012-05-08util: split-out path-util.[ch]Kay Sievers
2012-04-12shutdown: move shutdown to core since it replaces PID 1Lennart Poettering