On Tue, May 06, 2008 at 09:36:06AM -0700, Linus Torvalds wrote: > On Tue, 6 May 2008, Matthew Wilcox wrote: > > I've wanted to fix file locks for a while. Here's a first attempt. > > It was done quickly, so I concede that it may well have bugs in it. > > I found (and fixed) one with LTP. > > Hmm. Wouldn't it be nicer to make the lock be a per-inode thing? Or is > there some user that doesn't have the inode info, or does anything that > might cross inode boundaries? /proc/locks and deadlock detection both cross inode boundaries (and even filesystem boundaries). The BKL-removal brigade tried this back in 2.4 and the locking ended up scaling worse than just plonking a single spinlock around the whole thing. > This does seem to drop all locking around the "setlease()" calls down to > the filesystem, which worries me. That said, we clearly do need to do > this. Probably should have done it a long time ago. The only filesystems that are going to have their own setlease methods will be remote ones (nfs, smbfs, etc). They're going to need to sleep while the server responds to them. So holding a spinlock while we call them is impolite at best. > Also, why do people do this: > > > -find_conflict: > > + find_conflict: > > Hmm? So that find_conflict doesn't end up in the first column, which causes diff to treat it as a function name for the purposes of the @@ lines. -- Intel are signing my paycheques ... these opinions are still mine "Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step." -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html