Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753042AbbBQT36 (ORCPT ); Tue, 17 Feb 2015 14:29:58 -0500 Received: from mail-ig0-f169.google.com ([209.85.213.169]:50115 "EHLO mail-ig0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752044AbbBQT35 (ORCPT ); Tue, 17 Feb 2015 14:29:57 -0500 MIME-Version: 1.0 In-Reply-To: References: <20150209055540.2f2a3689@tlielax.poochiereds.net> <20150216133200.GB3270@node.dhcp.inet.fi> <20150216090054.62455465@tlielax.poochiereds.net> <20150217190844.GC27900@fieldses.org> Date: Tue, 17 Feb 2015 11:29:56 -0800 X-Google-Sender-Auth: jA8aBrafaXvCHAvXiWdmh3VWbxU Message-ID: Subject: Re: [GIT PULL] please pull file-locking related changes for v3.20 From: Linus Torvalds To: "J. Bruce Fields" Cc: Jeff Layton , "Kirill A. Shutemov" , linux-fsdevel , Linux Kernel Mailing List , Christoph Hellwig , Dave Chinner , Sasha Levin Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1294 Lines: 29 On Tue, Feb 17, 2015 at 11:13 AM, Linus Torvalds wrote: > > That said, I'm not at all sure about the "we're stuck with it". We can > improve the semantics without anybody noticing, because it's not like > anybody could *depend* on the weaker semantics - they needed > particular races and timings to hit anyway. .. that said, it's true that we cannot do the FILE_LOCK_DEFERRED thing for multiple blockers that already hold a lock. One of them has to release its lock for other lockers to make progress. So I guess the weak model of dropping a read lock before taking a write lock is actually required. That sleep in the middle with dropping the lock is still complete crap, though. You can't do it. If you drop the lock, you have to repeat the while cycle, not just sleep and continue. Or just go to sleep, waiting for the conflicting lock to also be dropped. So maybe just removing that whole "if (found) { reschedule }" - but leaving the "drop early - is the right thing to do. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/