Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3919751pxv; Mon, 28 Jun 2021 16:40:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYgKSnNJ5vQZqYSv+NKx9okBSlLVLh3jCPhV3XojQQQGsp3iCLjGHsybWh8eTpzptONdft X-Received: by 2002:a05:6e02:1288:: with SMTP id y8mr19337107ilq.86.1624923654533; Mon, 28 Jun 2021 16:40:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624923654; cv=none; d=google.com; s=arc-20160816; b=TLtld7UtFi8wL/0Tvy1UB1aMKKiq0aqyO9YIG+51MEWhJDT8wpZ9G451CIY/mlHn2c 6NN43CiXPK3bN9+SXcLzbXNmGuHRzPOk5ARpEo3N8BGyAk6mHot2uPTvTLqU/yBTfz6g eQ3m6+bn1Oz9ZQRdH0li99Rc8XgKgI2N9pycu9NPz9uzfX7+Ft/6j4kuuXOKVdhSKQYS ZTXb0ICYnsfaGphqEco3gia13fpfGiQVXp1JY002Sk/a55wuvMjxitnK1ND3BNR/CDV4 xxfKPKIdgk5t27WNw6Xo7rJBVJiqRADTgOE65QKtGamIu/DQx12PsdINeZXQe5tTBn1C KldQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:from:user-agent:content-disposition:mime-version :message-id:subject:cc:to:date:dkim-signature:dkim-filter; bh=KcfAkSKsZA83wExNAdCpkp41/vEwBLTBCNj5A2LFKsQ=; b=TTAStcGtjLreO3JYFuc/TFZbKIucJYVHGQuOzKc/BmGOhtXLks/MGOLS33QypfkVkv Lm7bIPQbemRfRDcgqyD4KuMPcXCqTKOdMbfoLaQrfyIeZFJMf+3ml6x+EKDZ56ikXHE9 Ry4lxqag9FybiDTCDerFUA7fGC10uMTpR1JlgQLBwOEVeKT+d9sLge/P4SkcJ0KvcFwf CNs4d+nm6Z43idxQN5Sq+66A+lwOWxKSj6mx5/RzU5KXkpDG8qurEYEpSbAGyuvQtB+4 1pbtGJSS/1soWwjPIePKqziwe6zih7vuFBsrysAN0ekiPHIvqUUU9U3MslVfGNpodG5g HF5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=He6BHTl7; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w19si1633719jal.79.2021.06.28.16.40.40; Mon, 28 Jun 2021 16:40:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=He6BHTl7; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235444AbhF1Tvg (ORCPT + 99 others); Mon, 28 Jun 2021 15:51:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233996AbhF1Tvg (ORCPT ); Mon, 28 Jun 2021 15:51:36 -0400 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37FAEC061574; Mon, 28 Jun 2021 12:49:09 -0700 (PDT) Received: by fieldses.org (Postfix, from userid 2815) id 6C430478E; Mon, 28 Jun 2021 15:49:08 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org 6C430478E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieldses.org; s=default; t=1624909748; bh=KcfAkSKsZA83wExNAdCpkp41/vEwBLTBCNj5A2LFKsQ=; h=Date:To:Cc:Subject:From:From; b=He6BHTl7MlbXhhFdUZKvW7enb+/75f23/B+8QdDBeLJzeAwX+pAtOsUWNWCqJR9S3 TTDnnbWInOyQu+fCCQUydNGp3az46KoZ8FctTvUS1GmoWhmfWJc3pTYDcQNPa0pCV9 jOU6TNLi/+A0lI2ecc9EbuQZ1cmmKXxwxAqp70RY= Date: Mon, 28 Jun 2021 15:49:08 -0400 To: linux-fsdevel@vger.kernel.org Cc: dai.ngo@oracle.com, linux-nfs@vger.kernel.org Subject: automatic freeing of space on ENOSPC Message-ID: <20210628194908.GB6776@fieldses.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) From: bfields@fieldses.org (J. Bruce Fields) Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Is there anything analogous to a "shrinker", but for disk space? So, some hook that a filesystem could call to say "I'm running out of space, could you please free something?", before giving up and returning ENOSPC? The NFS server currently revokes a client's state if the client fails to contact it within a lease period (90 seconds by default). That's harsher than necessary--if a network partition lasts longer than a lease period, but if nobody else needs that client's resources, it'd be nice to be able to hang on to them so that the client could resume normal operation after the network comes back. So we'd delay revoking the client's state until there's an actual conflict. But that means we need a way to clean up the client as soon as there is a conflict, to avoid unnecessarily failing operations that conflict with resources held by an expired client. At first I thought we only needed to worry about file locks, but then I realized clients can also hold references to files, which might be unlinked. I don't want a long-expired client to result in ENOSPC to other filesystem users. Any ideas? I searched around and found this discussion of volatile ranges https://lwn.net/Articles/522135/, which seems close, but I don't know if anything came of that in the end. --b.