Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua
wendelin.core
Commits
efdf1420
Commit
efdf1420
authored
Feb 18, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
4a38e910
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
wcfs/client/wcfs.cpp
wcfs/client/wcfs.cpp
+12
-6
No files found.
wcfs/client/wcfs.cpp
View file @
efdf1420
...
...
@@ -248,11 +248,16 @@ error _Conn::__pin1(PinReq *req) {
tie
(
f
,
ok
)
=
wconn
.
_filehtab
.
get_
(
req
->
foid
);
if
(
!
ok
)
{
wconn
.
_filehmu
.
unlock
();
return
fmt
::
errorf
(
"unexpected pin: file not watched"
);
// why wcfs sent us this update?
// why wcfs sent us this update?
return
fmt
::
errorf
(
"unexpected pin: f<%s> not watched"
,
v
(
req
->
foid
));
}
// XXX relock wconn -> f
// wconn.mu.unlock()
// f.mu.lock()
//
// XXX (?) NOTE: _not_ taking wconn.atMu at all (think more / explain why)
// (e.g. deadlock with Conn.resync (wlocks atMu))
for
(
auto
mmap
:
f
->
_mmaps
)
{
// TODO use ↑blk_start for binary search
if
(
!
(
mmap
->
blk_start
<=
req
->
blk
&&
req
->
blk
<
mmap
->
blk_stop
()))
...
...
@@ -429,11 +434,10 @@ pair<Mapping, error> _FileH::mmap(int64_t blk_start, int64_t blk_len, VMA *vma)
panic
(
"(blk_start + blk_len)*f.blksize overflow int64"
);
int64_t
start
=
blk_start
*
f
.
blksize
;
// XXX wconn.atMu.RLock()
// XXX defer wconn.atMu.RUnlock()
// NOTE virtmem lock is held by virtmem caller
// XXX f locking?
// XXX locking
// XXX + wconn.atMu.RLock() ? -> y (e.g. f.headfsize is used)
// f.mu.lock()
// create memory with head/f mapping and applied pins
// mmap-in zeros after f.size (else access to memory after file.size will raise SIGBUS)
...
...
@@ -505,6 +509,7 @@ error _Mapping::unmap() {
// NOTE virtmem lock is held by virtmem caller
// XXX locking
// wconn.atMu.RLock() + f.mu.lock()
if
(
mmap
->
vma
!=
nil
)
{
mmap
->
_assertVMAOk
();
...
...
@@ -618,6 +623,7 @@ error _Mapping::_remmapblk(int64_t blk, zodb::Tid at) {
v
(
f
->
wconn
->
_wc
->
mountpoint
),
v
(
f
->
wconn
->
at
),
v
(
f
->
foid
),
blk
,
v
(
at
));
// XXX locking done by callers (document)
// XXX cannot use wconn.at ^^^ because pinner does not lock wconn.atMu at all?
ASSERT
(
mmap
->
blk_start
<=
blk
&&
blk
<
mmap
->
blk_stop
());
error
err
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment