Skip to content

Commit

Permalink
Merge pull request #6869 from nextcloud/backport/6868/stable-3.13
Browse files Browse the repository at this point in the history
[stable-3.13] avoid deadlock: cancel hydration requests coming from itself
  • Loading branch information
mgallien authored Jul 1, 2024
2 parents 0324395 + 3a34b39 commit d8d7b03
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/libsync/vfs/cfapi/cfapiwrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ void CALLBACK cfApiFetchDataCallback(const CF_CALLBACK_INFO *callbackInfo, const
callbackInfo->FileSize.QuadPart);
};

if (QCoreApplication::applicationPid() == callbackInfo->ProcessInfo->ProcessId) {
qCCritical(lcCfApiWrapper) << "implicit hydration triggered by the client itself. Will lead to a deadlock. Cancel";
sendTransferError();
return;
}

auto vfs = reinterpret_cast<OCC::VfsCfApi *>(callbackInfo->CallbackContext);
Q_ASSERT(vfs->metaObject()->className() == QByteArrayLiteral("OCC::VfsCfApi"));
const auto path = QString(QString::fromWCharArray(callbackInfo->VolumeDosName) + QString::fromWCharArray(callbackInfo->NormalizedPath));
Expand Down

0 comments on commit d8d7b03

Please sign in to comment.