From c87c9c14daba47a95356dd1b8f6566e0b9f72525 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 16 Jul 2014 17:14:19 -0700 Subject: [PATCH] Added missing unlock() calls in LocalFile Change-Id: Id427fb424bfb46670f2074664aca750014c70225 --- includes/filerepo/file/LocalFile.php | 4 ++++ 1 file changed, 4 insertions(+) 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; -- 2.20.1