Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 70759
b: refs/heads/master
c: a131de0
h: refs/heads/master
i:
  70757: 066ac19
  70755: 3351dfe
  70751: ffdc6a1
v: v3
  • Loading branch information
Miklos Szeredi authored and Linus Torvalds committed Oct 17, 2007
1 parent b15fc86 commit e2db253
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 819c4b3b4009275caae973691378235c177a1429
refs/heads/master: a131de0a482ac95e6469f56981c7b063593fdc5d
43 changes: 24 additions & 19 deletions trunk/fs/fuse/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,28 +273,41 @@ static void request_wait_answer(struct fuse_conn *fc, struct fuse_req *req)
queue_interrupt(fc, req);
}

if (req->force) {
spin_unlock(&fc->lock);
wait_event(req->waitq, req->state == FUSE_REQ_FINISHED);
spin_lock(&fc->lock);
} else {
if (!req->force) {
sigset_t oldset;

/* Only fatal signals may interrupt this */
block_sigs(&oldset);
wait_answer_interruptible(fc, req);
restore_sigs(&oldset);

if (req->aborted)
goto aborted;
if (req->state == FUSE_REQ_FINISHED)
return;

/* Request is not yet in userspace, bail out */
if (req->state == FUSE_REQ_PENDING) {
list_del(&req->list);
__fuse_put_request(req);
req->out.h.error = -EINTR;
return;
}
}

if (req->aborted)
goto aborted;
if (req->state == FUSE_REQ_FINISHED)
return;
/*
* Either request is already in userspace, or it was forced.
* Wait it out.
*/
spin_unlock(&fc->lock);
wait_event(req->waitq, req->state == FUSE_REQ_FINISHED);
spin_lock(&fc->lock);

req->out.h.error = -EINTR;
req->aborted = 1;
if (!req->aborted)
return;

aborted:
BUG_ON(req->state != FUSE_REQ_FINISHED);
if (req->locked) {
/* This is uninterruptible sleep, because data is
being copied to/from the buffers of req. During
Expand All @@ -305,14 +318,6 @@ static void request_wait_answer(struct fuse_conn *fc, struct fuse_req *req)
wait_event(req->waitq, !req->locked);
spin_lock(&fc->lock);
}
if (req->state == FUSE_REQ_PENDING) {
list_del(&req->list);
__fuse_put_request(req);
} else if (req->state == FUSE_REQ_SENT) {
spin_unlock(&fc->lock);
wait_event(req->waitq, req->state == FUSE_REQ_FINISHED);
spin_lock(&fc->lock);
}
}

static unsigned len_args(unsigned numargs, struct fuse_arg *args)
Expand Down

0 comments on commit e2db253

Please sign in to comment.