From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6902C433E0 for ; Thu, 28 May 2020 22:02:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A4A97206F1 for ; Thu, 28 May 2020 22:02:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2436821AbgE1WBp (ORCPT ); Thu, 28 May 2020 18:01:45 -0400 Received: from fieldses.org ([173.255.197.46]:36576 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2436784AbgE1WBe (ORCPT ); Thu, 28 May 2020 18:01:34 -0400 Received: by fieldses.org (Postfix, from userid 2815) id 510926D9; Thu, 28 May 2020 18:01:12 -0400 (EDT) Date: Thu, 28 May 2020 18:01:12 -0400 From: "J. Bruce Fields" To: NeilBrown Cc: Jeff Layton , Linux FS-devel Mailing List Subject: Re: The file_lock_operatoins.lock API seems to be a BAD API. Message-ID: <20200528220112.GD20602@fieldses.org> References: <87a71s8u23.fsf@notabene.neil.brown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87a71s8u23.fsf@notabene.neil.brown.name> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Thu, May 28, 2020 at 04:14:44PM +1000, NeilBrown wrote: > I don't think we should just fix all those bugs in those filesystems. > I think that F_UNLCK should *always* remove the lock/lease. > I imaging this happening by *always* calling posix_lock_file() (or > similar) in the unlock case - after calling f_op->lock() first if that > is appropriate. > > What do people think? It there on obvious reason that is a non-starter? Isn't NFS unlock like close, in that it may be our only chance to return IO errors? But I guess you're not saying that unlock can't return errors, just that it should always remove the lock whether it returns 0 or not. Hm. --b.