summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Rosenberg <drosen@google.com>2019-04-02 20:25:05 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-04-02 20:25:05 +0000
commit07a8c9f8debd48051a3f6d2de3bee9cc576697ad (patch)
tree9b5bcba0b8a55c5b85a0c05275065eb47cafd7a0
parent654a37cd657593c9a01ff586f55b0b308f9c3474 (diff)
parent96731d84db05b7b67613e70eff789c113bd5ad2a (diff)
downloadextras-07a8c9f8debd48051a3f6d2de3bee9cc576697ad.tar.gz
Merge "Make checkpoint_gc.sh robust against interference"
-rw-r--r--checkpoint_gc/checkpoint_gc.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/checkpoint_gc/checkpoint_gc.sh b/checkpoint_gc/checkpoint_gc.sh
index d5f7ab40..93785804 100644
--- a/checkpoint_gc/checkpoint_gc.sh
+++ b/checkpoint_gc/checkpoint_gc.sh
@@ -44,7 +44,6 @@ DIRTY_SEGMENTS=${DIRTY_SEGMENTS_START}
TODO_SEGMENTS=$((${DIRTY_SEGMENTS_START}-${DIRTY_SEGMENTS_THRESHOLD}))
echo $DIRTY_SEGMENTS_START
while [ ${DIRTY_SEGMENTS} -gt ${DIRTY_SEGMENTS_THRESHOLD} ]; do
- echo $DIRTY_SEGMENTS
PROGRESS=`echo "(${DIRTY_SEGMENTS_START}-${DIRTY_SEGMENTS})/${TODO_SEGMENTS}"|bc -l`
if [[ $PROGRESS == -* ]]; then
PROGRESS=0
@@ -52,6 +51,8 @@ while [ ${DIRTY_SEGMENTS} -gt ${DIRTY_SEGMENTS_THRESHOLD} ]; do
print -u${STATUS_FD} "global_progress ${PROGRESS}"
read DIRTY_SEGMENTS < /sys/fs/f2fs/${NAME}/dirty_segments
sleep ${SLEEP}
+ # In case someone turns it off behind our back
+ echo 1 > /sys/fs/f2fs/${NAME}/gc_urgent
done
log -pi -t checkpoint_gc Turning off GC for ${NAME}