From: Aaron Schulz Date: Thu, 17 Jul 2014 00:14:19 +0000 (-0700) Subject: Added missing unlock() calls in LocalFile X-Git-Tag: 1.31.0-rc.0~14913^2 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=c87c9c14daba47a95356dd1b8f6566e0b9f72525;p=lhc%2Fweb%2Fwiklou.git Added missing unlock() calls in LocalFile Change-Id: Id427fb424bfb46670f2074664aca750014c70225 --- diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index 300e68e981..a01895f0ff 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -594,6 +594,7 @@ class LocalFile extends File { # Don't destroy file info of missing files if ( !$this->fileExists ) { + $this->unlock(); wfDebug( __METHOD__ . ": file does not exist, aborting\n" ); wfProfileOut( __METHOD__ ); @@ -604,6 +605,7 @@ class LocalFile extends File { list( $major, $minor ) = self::splitMime( $this->mime ); if ( wfReadOnly() ) { + $this->unlock(); wfProfileOut( __METHOD__ ); return; @@ -2829,6 +2831,7 @@ class LocalFileMoveBatch { // cleanupTarget() to trigger. It would delete the C files and cause data loss. $statusDb = $this->doDBUpdates(); if ( !$statusDb->isGood() ) { + $destFile->unlock(); $this->file->unlockAndRollback(); $statusDb->ok = false; @@ -2846,6 +2849,7 @@ class LocalFileMoveBatch { if ( !$statusMove->isGood() ) { // Delete any files copied over (while the destination is still locked) $this->cleanupTarget( $triplets ); + $destFile->unlock(); $this->file->unlockAndRollback(); // unlocks the destination wfDebugLog( 'imagemove', "Error in moving files: " . $statusMove->getWikiText() ); $statusMove->ok = false;