summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2019-02-11 00:37:40 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2019-02-11 00:37:40 +0000
commite9a9339542b59d6c588e2e8074a0df6be148e5e8 (patch)
treeff91c1997fb5bede44606f2cbd567cc736ae8c99
parentAdd missing flush in async test case (diff)
downloadnetfs-1.3.2.1.tar.bz2
netfs-1.3.2.1.tar.xz
netfs-1.3.2.1.zip
Copy write states while still holding locknetfs-1.3.2.1
-rw-r--r--netfs/fuse/fuseFiles.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/netfs/fuse/fuseFiles.cpp b/netfs/fuse/fuseFiles.cpp
index b8eb014..bbb7548 100644
--- a/netfs/fuse/fuseFiles.cpp
+++ b/netfs/fuse/fuseFiles.cpp
@@ -130,13 +130,13 @@ FuseApp::waitOnWriteRangeAndThen(size_t s, off_t o, const OpenFilePtr & of, cons
return f(key);
}
else {
- // Wait for them whilst unlocked
- _l.release()->unlock();
std::vector<std::shared_ptr<OpenFile::WriteState>> overlap;
overlap.reserve(std::distance(R.first, R.second));
for (auto i = R.first; i != R.second; i++) {
overlap.push_back(i->second);
}
+ // Wait for them whilst unlocked
+ _l.release()->unlock();
for (const auto & r : overlap) {
r->future.wait();
}
@@ -178,7 +178,7 @@ FuseApp::write(const char *, const char * buf, size_t s, off_t o, struct fuse_fi
auto of = getProxy<OpenFilePtr>(fi->fh);
auto remote = of->remote;
if (fcr->Async) {
- waitOnWriteRangeAndThen<void>(s, o, of, [o, s, buf, &of, &remote](const auto & key){
+ waitOnWriteRangeAndThen<void>(s, o, of, [o, s, buf, &of, remote](const auto & key){
auto p = std::make_shared<OpenFile::WriteState>();
remote->writeAsync(o, s, Buffer(buf, buf + s), [p,of,key]() {
p->promise.set_value();