Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754767AbbBQTzE (ORCPT ); Tue, 17 Feb 2015 14:55:04 -0500 Received: from mail-ig0-f169.google.com ([209.85.213.169]:41896 "EHLO mail-ig0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752760AbbBQTzC (ORCPT ); Tue, 17 Feb 2015 14:55:02 -0500 MIME-Version: 1.0 In-Reply-To: <1424177190-14252-1-git-send-email-jeff.layton@primarydata.com> References: <1424177190-14252-1-git-send-email-jeff.layton@primarydata.com> Date: Tue, 17 Feb 2015 11:55:01 -0800 X-Google-Sender-Auth: ynTznS10HKmFY2mZl0hpOrlb0KM Message-ID: Subject: Re: [PATCH 0/4] locks: flock and lease related bugfixes, and remove i_flctx counters From: Linus Torvalds To: Jeff Layton Cc: linux-fsdevel , Linux Kernel Mailing List , "Kirill A. Shutemov" , "J. Bruce Fields" , 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: 1202 Lines: 31 Ok, so having gone over these, I think 1, 2 and 4 are fine. Let's just drop 3. The upgrade clearly does need to drop the old lock when returning FILE_LOCK_DEFERRED, because otherwise two upgraders will deadlock waiting for each other. Oh, and in #1, you might want to remove the "FIXME: add counters to struct file_lock_context so we don't need to do this?" although that obviously makes it not strictly a 100% revert. I do believe that we should add a "list_count()" function, so that we could write *flock_count = list_count(&ctx->flc_flock); instead of that horribly ugly list_for_each_entry(lock, &ctx->flc_flock, fl_list) ++(*flock_count); thing. But that's a separate cleanup. Can we get that truncated series tested with some flock test suite? I assume there is *some* filesystem tester that tests some basic flock stuff, even if it clearly didn't catch the race due to the unlock in the middle.. 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/