Skip to contentSkip to conversation

generic/192: Fix instability on exFAT

PATCH New Pavel Reichl 1 participant 1 message Apr 27, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 generic/192: Fix instability on exFAT

exFAT's access time has 2s granularity and is rounded down.

This can cause problems, e.g.:

	if real access times are: time1=2 and time2=7, then 7 - 2 = 5;
	but exfat_atime(7) - exfat_atime(2) => 6 - 2 = 4 which is less
	than expected delay.

To fix this, even (delay - 1s) should be considered as a valid result for exFAT.

---
 tests/generic/192 | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
tests/generic/192 +6 -1
index 900e2cb5..2bc8835f 100755
@@ -52,8 +52,13 @@ time3=`_access_time $testfile | tee -a $seqres.full`
 delta1=`expr $time2 - $time1`
 delta2=`expr $time3 - $time1`
 
+min_tol=0
+if [ "$FSTYP" = "exfat" ]; then
+	min_tol=1
+fi
+
 # tolerate an atime up to 2s later than the ideal case
-_within_tolerance "delta1" $delta1 $delay  0 2 -v
+_within_tolerance "delta1" $delta1 $delay $min_tol 2 -v
 _within_tolerance "delta2" $delta2 $delta1 0 0 -v
 
 # success, all done
Signature · 1 line
2.30.2