From: Aaron Schulz Date: Thu, 18 Oct 2012 21:58:32 +0000 (-0700) Subject: [FileBackend] Clear persistent stat cache if it mislead streamFile(). X-Git-Tag: 1.31.0-rc.0~21955 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=1941cfe369e0bd4170ed54da5e27005636049b28;p=lhc%2Fweb%2Fwiklou.git [FileBackend] Clear persistent stat cache if it mislead streamFile(). Change-Id: Ie02e9e0c56180d8cbd2507b795cd960f3ba84f33 --- diff --git a/includes/filebackend/FileBackendStore.php b/includes/filebackend/FileBackendStore.php index 3000d2d37b..39cfc2d24f 100644 --- a/includes/filebackend/FileBackendStore.php +++ b/includes/filebackend/FileBackendStore.php @@ -834,6 +834,13 @@ abstract class FileBackendStore extends FileBackend { $status = $this->doStreamFile( $params ); wfProfileOut( __METHOD__ . '-send-' . $this->name ); wfProfileOut( __METHOD__ . '-send' ); + if ( !$status->isOK() ) { + // Per bug 41113, nasty things can happen if bad cache entries get + // stuck in cache. It's also possible that this error can come up + // with simple race conditions. Clear out the stat cache to be safe. + $this->clearCache( array( $params['src'] ) ); + $this->deleteFileCache( $params['src'] ); + } } else { $status->fatal( 'backend-fail-stream', $params['src'] ); }