Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/146991

Change subject: Added missing unlock() calls in LocalFile
......................................................................

Added missing unlock() calls in LocalFile

Change-Id: Id427fb424bfb46670f2074664aca750014c70225
---
M includes/filerepo/file/LocalFile.php
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/91/146991/1

diff --git a/includes/filerepo/file/LocalFile.php 
b/includes/filerepo/file/LocalFile.php
index 300e68e..a01895f 100644
--- a/includes/filerepo/file/LocalFile.php
+++ b/includes/filerepo/file/LocalFile.php
@@ -594,6 +594,7 @@
 
                # 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 @@
                list( $major, $minor ) = self::splitMime( $this->mime );
 
                if ( wfReadOnly() ) {
+                       $this->unlock();
                        wfProfileOut( __METHOD__ );
 
                        return;
@@ -2829,6 +2831,7 @@
                // 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 @@
                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;

-- 
To view, visit https://gerrit.wikimedia.org/r/146991
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id427fb424bfb46670f2074664aca750014c70225
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to