From 65554ec33339ce5b0938c5fa94a76c9e1f0affce Mon Sep 17 00:00:00 2001
From: Robin Appelman <icewind@owncloud.com>
Date: Wed, 10 Feb 2016 16:21:13 +0100
Subject: scan the file in the write lock when uploading over dav

---
 apps/dav/lib/connector/sabre/file.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'apps/dav/lib')

diff --git a/apps/dav/lib/connector/sabre/file.php b/apps/dav/lib/connector/sabre/file.php
index be313a91e8c..9b753c01f60 100644
--- a/apps/dav/lib/connector/sabre/file.php
+++ b/apps/dav/lib/connector/sabre/file.php
@@ -194,15 +194,15 @@ class File extends Node implements IFile {
 				}
 			}
 
+			// since we skipped the view we need to scan and emit the hooks ourselves
+			$storage->getUpdater()->update($internalPath);
+
 			try {
 				$this->changeLock(ILockingProvider::LOCK_SHARED);
 			} catch (LockedException $e) {
 				throw new FileLocked($e->getMessage(), $e->getCode(), $e);
 			}
 
-			// since we skipped the view we need to scan and emit the hooks ourselves
-			$storage->getUpdater()->update($internalPath);
-
 			if ($view) {
 				$this->emitPostHooks($exists);
 			}
-- 
cgit v1.2.3


From bef70e9448931cf8229f26f2aed0579340089e9d Mon Sep 17 00:00:00 2001
From: Robin Appelman <icewind@owncloud.com>
Date: Wed, 10 Feb 2016 16:31:32 +0100
Subject: also fix lock order for chunked dav uploads

---
 apps/dav/lib/connector/sabre/file.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'apps/dav/lib')

diff --git a/apps/dav/lib/connector/sabre/file.php b/apps/dav/lib/connector/sabre/file.php
index 9b753c01f60..38a1ee5f4e2 100644
--- a/apps/dav/lib/connector/sabre/file.php
+++ b/apps/dav/lib/connector/sabre/file.php
@@ -450,11 +450,11 @@ class File extends Node implements IFile {
 					}
 				}
 
-				$this->fileView->changeLock($targetPath, ILockingProvider::LOCK_SHARED);
-
 				// since we skipped the view we need to scan and emit the hooks ourselves
 				$targetStorage->getUpdater()->update($targetInternalPath);
 
+				$this->fileView->changeLock($targetPath, ILockingProvider::LOCK_SHARED);
+
 				$this->emitPostHooks($exists, $targetPath);
 
 				$info = $this->fileView->getFileInfo($targetPath);
-- 
cgit v1.2.3