Skip to content

Commit d8d7b03

Browse files
authored
Merge pull request #6869 from nextcloud/backport/6868/stable-3.13
[stable-3.13] avoid deadlock: cancel hydration requests coming from itself
2 parents 0324395 + 3a34b39 commit d8d7b03

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/libsync/vfs/cfapi/cfapiwrapper.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,12 @@ void CALLBACK cfApiFetchDataCallback(const CF_CALLBACK_INFO *callbackInfo, const
157157
callbackInfo->FileSize.QuadPart);
158158
};
159159

160+
if (QCoreApplication::applicationPid() == callbackInfo->ProcessInfo->ProcessId) {
161+
qCCritical(lcCfApiWrapper) << "implicit hydration triggered by the client itself. Will lead to a deadlock. Cancel";
162+
sendTransferError();
163+
return;
164+
}
165+
160166
auto vfs = reinterpret_cast<OCC::VfsCfApi *>(callbackInfo->CallbackContext);
161167
Q_ASSERT(vfs->metaObject()->className() == QByteArrayLiteral("OCC::VfsCfApi"));
162168
const auto path = QString(QString::fromWCharArray(callbackInfo->VolumeDosName) + QString::fromWCharArray(callbackInfo->NormalizedPath));

0 commit comments

Comments
 (0)