6555ff0ad3
My understanding is that the CLRSIG() is supposed to clear the signal that was sent to the syncer process to prevent it from being delivered to the syncer process in case unmounting fails, so that the syncer process does not die while the filesystem is still mounted. The typical scenario is, the syncher process is tsleep()ing in the kernel, and waking up when it needs to do work. If someone sends a signal to it, eg. kill -TERM the mfs process, then the kernel will try to unmount the mfs filesystem before delivering the signal to the process. If that unmount fails, then we should not really kill the process because that will hang the mount. So we call CLRSIG() to stop the signal from being delivered. So the first call to issignal() will return the signal number that was sent to the syncer process (unless someone malicious was able to send a lower numbered signal between the time tsleep() returned and we called issignal()... something that is not really easy to do). But you are right, we should not be calling it many times as a side effect of this macro. Rewrite CLRSIG() clear all the signals and call issignal() the correct number of times. |
||
---|---|---|
.. | ||
Makefile | ||
mfs_extern.h | ||
mfs_vfsops.c | ||
mfs_vnops.c | ||
mfsnode.h |