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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D429C4332F for ; Fri, 25 Nov 2022 09:49:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8BD1C6B0073; Fri, 25 Nov 2022 04:49:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 86D766B0074; Fri, 25 Nov 2022 04:49:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 734F06B0075; Fri, 25 Nov 2022 04:49:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 61E746B0073 for ; Fri, 25 Nov 2022 04:49:26 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 1738640D81 for ; Fri, 25 Nov 2022 09:49:26 +0000 (UTC) X-FDA: 80171491932.24.F1AFE36 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf26.hostedemail.com (Postfix) with ESMTP id B4DB9140011 for ; Fri, 25 Nov 2022 09:49:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669369764; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xKbQmNMIGnlDgYvEteAlL0wXb/z4xDLJRKQD4d/vVoI=; b=bLhZdQmazrphAPD4muKY530EWtGv7O1iTC9L/fIvGhSBLviBQ3j4aBYg82q3i8wOG3gMTr BchWYkd9/UEvvWUgmPupSWTHOqUq0aCkzQCtLoWWchc+fFqFThpwBIYKZT98W5VBNrC/+4 DiCONVi4FCKZvFVSxrtaeGDrATx53aw= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-83-kQqoNabyND-Q-bGWIDEupw-1; Fri, 25 Nov 2022 04:49:20 -0500 X-MC-Unique: kQqoNabyND-Q-bGWIDEupw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0C6003815D2C; Fri, 25 Nov 2022 09:49:20 +0000 (UTC) Received: from fedora (ovpn-193-67.brq.redhat.com [10.40.193.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C0136FD48; Fri, 25 Nov 2022 09:49:18 +0000 (UTC) Date: Fri, 25 Nov 2022 10:49:16 +0100 From: Lukas Czerner To: Jan Kara Cc: Hugh Dickins , Jan Kara , Eric Sandeen , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, djwong@kernel.org Subject: Re: [PATCH v2 2/3] shmem: implement user/group quota support for tmpfs Message-ID: <20221125094916.4vutvnxt4wiulygw@fedora> References: <20221121142854.91109-1-lczerner@redhat.com> <20221121142854.91109-3-lczerner@redhat.com> <20221123163745.nnunvbl3s6th6kjx@quack3> <20221125085948.wbzzbimqeehcfqnh@fedora> <20221125091453.nm2lbxl743ggrqxq@quack3> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221125091453.nm2lbxl743ggrqxq@quack3> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1669369764; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=xKbQmNMIGnlDgYvEteAlL0wXb/z4xDLJRKQD4d/vVoI=; b=d5DKLaw+72w13h6cMohX7kTlUNbZ43BkDp8EW99IAL9cQ+n1TEAeevrKTLi9T2z4HuzNSe NgWc+3aN2yYNoBSBCUR2lMTDJxnK9JTMGVRUogWJaShqnqg3uc0UQDx1+S1FKde4+Uz+4s Ihg95QnjYYNNZCvwYcRcs1C+jCGOXqg= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=bLhZdQma; spf=pass (imf26.hostedemail.com: domain of lczerner@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=lczerner@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1669369764; a=rsa-sha256; cv=none; b=etlYuNd3MvN6uM68f7fXzEoygODBYLVHw/nP/gv9hWZBLBNFBSZu7Pg1a95ndoY7nVbq6S C7MMsbilsBcWC5RywLF9PHiwAcnx/5gpt1qa4QeoXEb9VKt5sjOwkZdB8QHweGfvnH3abH 9l0LEsYBLkX1WfpjX/g23dCmecxBDrM= X-Stat-Signature: mwdsd713zuky8m7s1gi67fbaxnt6orej X-Rspamd-Queue-Id: B4DB9140011 Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=bLhZdQma; spf=pass (imf26.hostedemail.com: domain of lczerner@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=lczerner@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspam-User: X-Rspamd-Server: rspam05 X-HE-Tag: 1669369764-123406 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Nov 25, 2022 at 10:14:53AM +0100, Jan Kara wrote: > On Fri 25-11-22 09:59:48, Lukas Czerner wrote: > > On Wed, Nov 23, 2022 at 05:37:45PM +0100, Jan Kara wrote: > > > On Mon 21-11-22 15:28:53, Lukas Czerner wrote: > > > > Implement user and group quota support for tmpfs using system quota file > > > > in vfsv0 quota format. Because everything in tmpfs is temporary and as a > > > > result is lost on umount, the quota files are initialized on every > > > > mount. This also goes for quota limits, that needs to be set up after > > > > every mount. > > > > > > > > The quota support in tmpfs is well separated from the rest of the > > > > filesystem and is only enabled using mount option -o quota (and > > > > usrquota and grpquota for compatibility reasons). Only quota accounting > > > > is enabled this way, enforcement needs to be enable by regular quota > > > > tools (using Q_QUOTAON ioctl). > > > > > > > > Signed-off-by: Lukas Czerner > > > > > > ... > > > > > > > diff --git a/Documentation/filesystems/tmpfs.rst b/Documentation/filesystems/tmpfs.rst > > > > index 0408c245785e..9c4f228ef4f3 100644 > > > > --- a/Documentation/filesystems/tmpfs.rst > > > > +++ b/Documentation/filesystems/tmpfs.rst > > > > @@ -86,6 +86,18 @@ use up all the memory on the machine; but enhances the scalability of > > > > that instance in a system with many CPUs making intensive use of it. > > > > > > > > > > > > +tmpfs also supports quota with the following mount options > > > > + > > > > +======== ============================================================= > > > > +quota Quota accounting is enabled on the mount. Tmpfs is using > > > > + hidden system quota files that are initialized on mount. > > > > + Quota limits can quota enforcement can be enabled using > > > ^^^ and? > > > > > > > + standard quota tools. > > > > +usrquota Same as quota option. Exists for compatibility reasons. > > > > +grpquota Same as quota option. Exists for compatibility reasons. > > > > > > As we discussed with V1, I'd prefer if user & group quotas could be enabled > > > / disabled independently. Mostly to not differ from other filesystems > > > unnecessarily. > > > > Ok, but other file systems (at least xfs and ext) differs. Mounting ext4 > > file system with quota feature with default quota option settings will > > always enable accounting for both user and group. Mount options quota, > > usrquota and grpquota enables enforcement; selectively with the last > > two. > > > > On xfs with no mount options quota is disabled. With quota, usrquota and > > grpquota enforcement is enabled, again selectively with the last two. > > > > And yes, with this implementation tmpfs is again different. The idea was > > to allow enabling accounting and enforcement (with default limits) > > selectively. > > > > So how would you like the tmpfs to do it? I think having accounting only > > can be useful and I'd like to keep it. Maybe adding qnoenforce, > > uqnoenforce and qgnoenforce mount options, but that seems cumbersome to > > me and enabling accounting by default seems a bit much. What do you think? > > So I wanted things to be as similar to other filesystems as possible. So > quota, usrquota, grpquota would enable quota accounting & enforcement (the > last two selectively). If we want the possibility to enable accounting > without enforcement that can be done by some special mount options (and > possibly we can add them when there's user demand). Also note that there's > always the possibility to disable quota enforcement using quota tools when > needed. But IMHO 99% of users will want accounting & enforcement and thus > that should be the default like with other filesystems. > > Honza Alright I'll do that. Thanks! -Lukas > -- > Jan Kara > SUSE Labs, CR >