From a7f9b883055cb1c4056469d498c7bc6564670c37 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Mon, 8 Apr 2019 14:28:39 -0400 Subject: [PATCH] fix ignored error --- check-subvol-stale | 11 +++-------- mount-latest-subvol | 3 ++- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/check-subvol-stale b/check-subvol-stale index 6a63124..dcc0535 100644 --- a/check-subvol-stale +++ b/check-subvol-stale @@ -28,7 +28,7 @@ usage: $0 SUBVOL_MOUNTPOINT... In git this is not not executable because it's meant to be installed using ./install-my-scripts -If latest subvols \$@ are not mounted, exit 1, print message, and print +If latest subvols \$@ are not mounted, print a message, and print the unstale subvol name into /nocow/btrfs-stale/\$subvol Fresh is opposite of stale. To be fresh, either SUBVOL_MOUNTPOINT is a @@ -67,7 +67,6 @@ stale-file() { if $stale; then mkdir -p $stale_dir printf "%s\n" $freshest_snap > $stale_file - ret=1 else rm -f $stale_file fi @@ -79,7 +78,6 @@ d() { fi } -ret=0 for d; do vol=${d##*/} # second field, non-comment line == $d @@ -134,9 +132,8 @@ for d; do ) if [[ ! $last_snap ]]; then # should not happen. - echo "$0: error: could not find latest snapshot for $svp among ${snaps[*]}" - ret=1 - continue + echo "$0: error: could not find latest snapshot for $svp among ${snaps[*]}" >&2 + exit 1 fi if [[ ! -e $svp ]]; then @@ -181,6 +178,4 @@ for d; do fi stale-file - done -exit $ret diff --git a/mount-latest-subvol b/mount-latest-subvol index 96210c4..540f9ab 100644 --- a/mount-latest-subvol +++ b/mount-latest-subvol @@ -219,7 +219,8 @@ for vol in q a o i; do # if latest is already mounted, make sure binds are mounted and move on - if e check-subvol-stale $d; then + e check-subvol-stale $d + if [[ -e /nocow/btrfs-stale/${d##*/} ]] ; then mnt $d for b in ${binds[@]}; do mnt $b -- 2.30.2