iankelling.org
/
git
/
distro-setup
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
3e7b531
)
fix ignored error
author
Ian Kelling
<iank@fsf.org>
Mon, 8 Apr 2019 18:28:39 +0000
(14:28 -0400)
committer
Ian Kelling
<iank@fsf.org>
Mon, 8 Apr 2019 18:28:39 +0000
(14:28 -0400)
check-subvol-stale
patch
|
blob
|
history
mount-latest-subvol
patch
|
blob
|
history
diff --git
a/check-subvol-stale
b/check-subvol-stale
index 6a63124cd3ac749028a794117e0da2df384dbcfd..dcc0535e6df227cc3b5b03f56a8a543b8df4eeb3 100644
(file)
--- 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
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
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
if $stale; then
mkdir -p $stale_dir
printf "%s\n" $freshest_snap > $stale_file
- ret=1
else
rm -f $stale_file
fi
else
rm -f $stale_file
fi
@@
-79,7
+78,6
@@
d() {
fi
}
fi
}
-ret=0
for d; do
vol=${d##*/}
# second field, non-comment line == $d
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.
)
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
fi
if [[ ! -e $svp ]]; then
@@
-181,6
+178,4
@@
for d; do
fi
stale-file
fi
stale-file
-
done
done
-exit $ret
diff --git
a/mount-latest-subvol
b/mount-latest-subvol
index 96210c4424907040ae4f284bf88ae330158d977d..540f9ab3a6278cb1ccad24890e74d9f93c1ee2f7 100644
(file)
--- 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 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
mnt $d
for b in ${binds[@]}; do
mnt $b