File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Source/WebKit/NetworkProcess/storage Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,15 @@ bool OriginQuotaManager::grantWithCurrentQuota(uint64_t spaceRequested)
110110 }
111111 m_quotaCountdown = *m_usage < m_quota ? m_quota - *m_usage : 0 ;
112112
113+ // As the overhead to store data by the underlying storage backend may be significant, the quota countdown may not
114+ // be accurate enough. Depending on the data size persisted, we may run out of disk space on constraint devices even
115+ // when quota is in theory available (when a lot of data is written without checking the real usage).
116+ // To mitigate this, we force the read of the real usage after consuming 25% of the theoretically available space.
117+ // If the remaining available space is too small that the overhead becomes insignificant (100 KB), we just take all
118+ // remaining space is available from that point on
119+ if (m_quotaCountdown > (100 *1024 ))
120+ m_quotaCountdown /= 4 ;
121+
113122 return grantFastPath (spaceRequested);
114123}
115124
You can’t perform that action at this time.
0 commit comments