From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arjan van de Ven Subject: Re: [PATCH] [Request for inclusion] Filesystem in Userspace Date: Tue, 16 Nov 2004 10:18:24 +0100 Message-ID: <1100596704.2811.17.camel@laptop.fenrus.org> References: Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: torvalds@osdl.org, akpm@osdl.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Return-path: Received: from canuck.infradead.org ([205.233.218.70]:40200 "EHLO canuck.infradead.org") by vger.kernel.org with ESMTP id S261949AbUKPJSl (ORCPT ); Tue, 16 Nov 2004 04:18:41 -0500 To: Miklos Szeredi In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Tue, 2004-11-16 at 10:08 +0100, Miklos Szeredi wrote: > Linus, > > I did send a pointer to the cleaned up patch, maybe this wasn't > explicit enough: > > http://fuse.sourceforge.net/kernel_patches/fuse-2.1-2.6.10-rc2.patch +static void request_wait_answer(struct fuse_req *req) +{ + spin_unlock(&fuse_lock); + wait_event(req->waitq, req->finished); + spin_lock(&fuse_lock); +} + spin_lock(&fuse_lock); + req->out.h.error = -ENOTCONN; + if (fc->file) { + req->in.h.unique = get_unique(fc); + list_add_tail(&req->list, &fc->pending); + wake_up(&fc->waitq); + request_wait_answer(req); + list_del(&req->list); + } + spin_unlock(&fuse_lock); somehow I find dropping the lock and then doing a list_del() without any kind of verification very suspicious. Either you need the lock or you don't. If you do, the code is wrong. If you don't... don't take the lock :)