Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4634159pxv; Tue, 29 Jun 2021 11:39:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+4ETeSpGZ5L2oyIBqxn+SOCm9BbKO6A9v1sjemBE/l/gC/WFcAVITv1V/YxZ4Jb6AOquk X-Received: by 2002:a17:906:d104:: with SMTP id b4mr31354794ejz.484.1624991973384; Tue, 29 Jun 2021 11:39:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624991973; cv=none; d=google.com; s=arc-20160816; b=epV9qZvzM2X6v844lWHedSEoZewio466kiob5UNYeic7CeGLrWGC2sjIchu61flyLb ApZ0qRedY6wx9wceG5pKZ2FFTE8fELfyHOBxZ+4+kJvVF8LCfYyaAu4XTZ0LlBYVNm2f m1fafxBVlYy6iVjTQkZAHHEiu0Oneob6KOMeb4xJT+5zUh8FglF2vhFCuIcEvxL0nOH7 QAu+CtClI4VJeDC3w+VKhHS3/jfBG8WTjiu5SFD6sRQ/Wc1tq3Qt2TBo4EqVbC0+UFte qI039wB0lqROuiL9Icxusd0GSqmImoHQ516bBeKH/H4kFG9CFMZ8SfOGAfaMrlpExS9z 9JZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-filter; bh=EyZ2HYvK9VUNhmzuIN4NcjPgGfykSAb4lP52n2zbWOc=; b=jFGXQcPBh7FdEnxaVvQeMQPpaEgFpCi3DqvBT7XrGHt3RIqlzLe4sP8rF31ccRfzTm ehhBpWaw1w0iCiZ3vMmCfzAp2NN2jDPtAERT+jRz9ms1St61b1+8VR+Fo67yzcbkkWV/ Ja3z3hXxxnuRto86f+9eFcllmbrkQPNbEHL8ecKT9jm1/CwcvV1QQAF7dMMhKBZZ/h1O L4GA5mM4ii2T4YqqzH32CarQ58VBJ65GQ+K2bvcUgbP2l0P/oJh3N2rdddY+ez9SnBjA 2lvsC1p8JpWpFhrYPqVoQWTB8HB6wOQBH4t8q/hheq/Tmp3469KW3Q8cvcZstrcBRMFk EOJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=HVwP+wFQ; 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 c1si7296064eds.31.2021.06.29.11.39.09; Tue, 29 Jun 2021 11:39:33 -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=HVwP+wFQ; 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 S235220AbhF2Skx (ORCPT + 99 others); Tue, 29 Jun 2021 14:40:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234971AbhF2Skx (ORCPT ); Tue, 29 Jun 2021 14:40:53 -0400 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2E57C061760; Tue, 29 Jun 2021 11:38:25 -0700 (PDT) Received: by fieldses.org (Postfix, from userid 2815) id 4526E478E; Tue, 29 Jun 2021 14:38:25 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org 4526E478E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieldses.org; s=default; t=1624991905; bh=EyZ2HYvK9VUNhmzuIN4NcjPgGfykSAb4lP52n2zbWOc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HVwP+wFQ+JvAnabKnpTOPdjdSFKE8ylRg4cQnqyTgQvo9yH6L7jDLUxw+nnBaxWpH 6K+ODc0ci6SP5/qfIZYwsbmhHFt/KcuYpSADHY6Vo+RZ9yPzgZh+gS5vOsuM+Un78A QGehk+ho5NoOqnPVAENfs6tE8Z8GoDL4uYX6bBXk= Date: Tue, 29 Jun 2021 14:38:25 -0400 From: "J. Bruce Fields" To: Theodore Ts'o Cc: linux-fsdevel@vger.kernel.org, dai.ngo@oracle.com, linux-nfs@vger.kernel.org Subject: Re: automatic freeing of space on ENOSPC Message-ID: <20210629183825.GD1926@fieldses.org> References: <20210628194908.GB6776@fieldses.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Tue, Jun 29, 2021 at 12:47:11PM -0400, Theodore Ts'o wrote: > On Mon, Jun 28, 2021 at 03:49:08PM -0400, J. Bruce Fields wrote: > > 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? > > In addition to the issues raised by Neil, Amir, Dave, and others, the > other challenge with the file system calling a "please try to free > something before I return ENOSPC" is that this would almost certainly > require blocking a system call while some userspace daemon tried to > free up some space --- or were you thinking that the nfsd kernel code > would be tracking all of the silly-rename files so it could release > space really quickly on demand? Something like that, yep. > Even if this is only a kernel callback, I'd be concerned about > potential locking hierarchy problems if we are calling out from block > allocation subsystem to nfsd, only to have nfsd call back in to > request unlinking a silly-renamed file. > > So the suggestion that we not wait until we're down to 0 blocks free, > but when we hit some threshold (say, free space dips below N minutes > worth of worst or average case block allocations), trigger code which > deletes silly-renamed files, is probably the best way to go. In which > case, a callback is not what is needed; and if N is large enough, this > could done via a pure user-space-only solution. Makes sense, thanks! --b.