From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Howells Subject: Re: [PATCH] fix race in mark_mounts_for_expiry() Date: Wed, 18 May 2005 12:51:39 +0100 Message-ID: <9498.1116417099@redhat.com> References: <1116005355.6248.372.camel@localhost> <1116012287.6248.410.camel@localhost> <1116013840.6248.429.camel@localhost> <1116256279.4154.41.camel@localhost> <20050516111408.GA21145@mail.shareable.org> <1116301843.4154.88.camel@localhost> <20050517012854.GC32226@mail.shareable.org> <1116360352.24560.85.camel@localhost> <1116399887.24560.116.camel@localhost> <1116400118.24560.119.camel@localhost> <6865.1116412354@redhat.com> <7230.1116413175@redhat.com> <8247.1 Cc: linuxram@us.ibm.com, jamie@shareable.org, viro@parcelfarce.linux.theplanet.co.uk, akpm@osdl.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Return-path: Received: from mx1.redhat.com ([66.187.233.31]:29120 "EHLO mx1.redhat.com") by vger.kernel.org with ESMTP id S262180AbVERLwK (ORCPT ); Wed, 18 May 2005 07:52:10 -0400 In-Reply-To: To: Miklos Szeredi Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Miklos Szeredi wrote: > Do you think my original fix is wrong, or is this just cosmetics? What you're doing is tricky. It's asking for a race. Admittedly, it may not occur in the particular situation you're looking at, but can you always guarantee that? Remember, it may be a race against some piece of code that's not yet written, by an author who doesn't realise what _you_ are doing here because their changeset doesn't intersect with yours. Remember: you have, in effect, made the usage count on that structure non-atomic. I do something like that in rwsems and it's something I have to be very careful about. The main reason I can get away with it is that the actual implementation of rwsems is small and is located in a very restrictes set of places and it's not intermingled with other stuff. David