From cac547059462a58ec26159cdc408f5828cfe40e5 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Mon, 1 Aug 2005 10:44:45 +0000 Subject: fix --- kernel/dev.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'kernel/dev.c') diff --git a/kernel/dev.c b/kernel/dev.c index 0f4de86..2c71a79 100644 --- a/kernel/dev.c +++ b/kernel/dev.c @@ -163,11 +163,13 @@ static void fuse_putback_request(struct fuse_conn *fc, struct fuse_req *req) else fuse_request_free(req); - /* If we are in debt decrease that first */ - if (fc->outstanding_debt) - fc->outstanding_debt--; - else - up(&fc->outstanding_sem); + if (!req->unaccounted) { + /* If we are in debt decrease that first */ + if (fc->outstanding_debt) + fc->outstanding_debt--; + else + up(&fc->outstanding_sem); + } spin_unlock(&fuse_lock); } @@ -322,9 +324,10 @@ static void queue_request(struct fuse_conn *fc, struct fuse_req *req) req->in.h.unique = fc->reqctr; req->in.h.len = sizeof(struct fuse_in_header) + len_args(req->in.numargs, (struct fuse_arg *) req->in.args); - if (!req->preallocated) { + if (!req->preallocated && !req->unaccounted) { /* If request is not preallocated (either FORGET or - RELEASE), then still decrease outstanding_sem, so + RELEASE), and is not unaccounted (SETLKW), + then still decrease outstanding_sem, so user can't open infinite number of files while not processing the RELEASE requests. However for efficiency do it without blocking, so if down() -- cgit v1.2.3