fix mistake from recent commit
authorIan Kelling <iank@fsf.org>
Mon, 8 Apr 2019 18:31:05 +0000 (14:31 -0400)
committerIan Kelling <iank@fsf.org>
Mon, 8 Apr 2019 18:31:05 +0000 (14:31 -0400)
mount-latest-subvol

index 540f9ab3a6278cb1ccad24890e74d9f93c1ee2f7..e1d4d1a74d56f4830d2de8319155cbfc51846ec5 100644 (file)
@@ -220,7 +220,8 @@ for vol in q a o i; do
 
   # if latest is already mounted, make sure binds are mounted and move on
   e check-subvol-stale $d
-  if [[ -e  /nocow/btrfs-stale/${d##*/} ]] ; then
+  # populated by check-subvol-stale if stale
+  if ! fresh_snap=$(</nocow/btrfs-stale/$vol); then
     mnt $d
     for b in ${binds[@]}; do
       mnt $b
@@ -228,14 +229,6 @@ for vol in q a o i; do
     continue
   fi
 
-  # populated by check-subvol-stale
-  fresh_snap=$(</nocow/btrfs-stale/$vol)
-  if [[ ! $fresh_snap ]]; then
-    echo "$0: error. empty fresh_snap var"
-    ret=1
-    continue
-  fi
-
   umount_ret=true
   unmounted=()
   for dir in $(echo $d ${binds[*]}\ |tac -s\ ); do