From: "Joseph D. Wagner" Subject: Re: [PATCH] fs/locks.c Partially fixes leases issue Date: Wed, 3 Dec 2003 21:49:21 +0600 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <200312032149.21849.theman@josephdwagner.info> References: <200312031748.37958.theman@josephdwagner.info> <20031204025516.GB1216@mail.shareable.org> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: matthew@wil.cx, willy@debian.org, linux-fsdevel@vger.kernel.org Return-path: Received: from ssa8.serverconfig.com ([209.51.129.179]:41136 "EHLO ssa8.serverconfig.com") by vger.kernel.org with ESMTP id S262738AbTLDDt3 (ORCPT ); Wed, 3 Dec 2003 22:49:29 -0500 To: Jamie Lokier In-Reply-To: <20031204025516.GB1216@mail.shareable.org> Content-Disposition: inline List-Id: linux-fsdevel.vger.kernel.org On Thursday, December 4, 2003 8:55 am, Jamie Lokier wrote: > These two are so similar they can be merged; just don't test "arg". That's what I through at first, but since this is only a partial patch, and a future patch would need to run additional checks independent of any write leases, I figured that it would be easier for the next guy if it had its own section so the next guy would know where the patch goes and have an easier time figuring it out. > The long comment which I wrote as "[...]" above is excessive: the code > is clear without it. If every small patch had a comment that large, > the kernel would be all comments and it paradoxically makes it harder > to understand the code. OK. Since I'm new at this, I don't know how clear my code (or everyone else's) is, so I wanted to error on the side of caution. > I don't agree with this patch as it is because, as Sean Neakums > pointed out, there is actually a field `inode->i_writecount' which is > remarkeably appropriate. > > F_RDLCK should use `deny_write_access', and `get_write_access' should > be changed to break any F_RDLCK leases. (Checking that locking for > `break_lease' in the places where `get_write_access' is called is left > as an exercise). > > F_WRLCK should use `get_write_accesss' because taking a write lease is > equivalent to demanding write access - it should break any outstanding > F_RDLCK leases. Alternatively, F_WRLCK should insist that > `filp->f_mode & FMODE_WRITE' is set. As I said, it's just a partial fix until someone does all that stuff you describe. I really don't know enough to do all that, at least not yet. Are you saying my patch won't get in? Joseph D. Wagner