[CRIU] [PATCH 1/2] scripts: return non zero if save_mountpoint() fails

Eugene Kolomeetz klm at virtuozzo.com
Tue Jun 7 08:42:45 PDT 2016


In such case, we must not proceed: without saved mountpoint, we risk
losing data when restarting automount service (think about tmpfs).
Currently, zero will be returned as exit status of preceeding echo.
https://jira.sw.ru/browse/PSBM-44207

Signed-off-by: Eugene Kolomeetz <klm at virtuozzo.com>
---
 scripts/systemd-autofs-restart.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/scripts/systemd-autofs-restart.sh b/scripts/systemd-autofs-restart.sh
index d069638..dd2ee13 100755
--- a/scripts/systemd-autofs-restart.sh
+++ b/scripts/systemd-autofs-restart.sh
@@ -97,7 +97,7 @@ function save_mountpoint {
 	bindmount=$($JOIN_CT mktemp -d)
 	if [ -z "$bindmount" ]; then
 		echo "Failed to create temporary directory"
-		return
+		return 1
 	fi
 
 	# No need to unmount fs on top of autofs:
-- 
1.7.6



More information about the CRIU mailing list