summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Rosenberg <drosen@google.com>2019-04-02 15:07:31 -0700
committerandroid-build-merger <android-build-merger@google.com>2019-04-02 15:07:31 -0700
commit5c73e66be54cb76f19468a2c61bb4d5094f0b590 (patch)
tree9b5bcba0b8a55c5b85a0c05275065eb47cafd7a0
parent17226e5ef69bd8b8326fc2cb9a8cfd5140ac17ae (diff)
parentdfc3247d58b68a2cca3721daea3546bcff808027 (diff)
downloadextras-5c73e66be54cb76f19468a2c61bb4d5094f0b590.tar.gz
Merge "Make checkpoint_gc.sh robust against interference" am: 07a8c9f8de
am: dfc3247d58 Change-Id: I33d144fe33ed91941fa925c451522ffe169acba5
-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}