linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Lukas Czerner <lczerner@redhat.com>
To: Jan Kara <jack@suse.cz>
Cc: Hugh Dickins <hughd@google.com>, Jan Kara <jack@suse.com>,
	Eric Sandeen <sandeen@redhat.com>,
	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
Date: Fri, 25 Nov 2022 10:49:16 +0100	[thread overview]
Message-ID: <20221125094916.4vutvnxt4wiulygw@fedora> (raw)
In-Reply-To: <20221125091453.nm2lbxl743ggrqxq@quack3>

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 <lczerner@redhat.com>
> > > 
> > > ...
> > > 
> > > > 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 <jack@suse.com>
> SUSE Labs, CR
> 



  reply	other threads:[~2022-11-25  9:49 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-21 14:28 [PATCH v2 0/3] [RFC] shmem: user and group " Lukas Czerner
2022-11-21 14:28 ` [PATCH v2 1/3] quota: add quota in-memory format support Lukas Czerner
2022-11-21 17:48   ` Darrick J. Wong
2022-11-22  9:04     ` Lukas Czerner
2022-11-22 15:23       ` Brian Foster
2022-11-23  9:52         ` Lukas Czerner
2022-11-23 12:32           ` Brian Foster
2022-11-22 12:59     ` Christoph Hellwig
2022-11-22 14:21       ` Lukas Czerner
2022-11-23  7:58         ` Christoph Hellwig
2022-11-23  8:36           ` Lukas Czerner
2022-11-23 12:37             ` Brian Foster
2022-11-23 18:09             ` Darrick J. Wong
2022-11-23 17:07   ` Jan Kara
2022-11-25  9:30     ` Lukas Czerner
2022-11-28 10:03       ` Jan Kara
2022-11-29 11:21   ` Christian Brauner
2022-11-29 13:11     ` Lukas Czerner
2022-11-21 14:28 ` [PATCH v2 2/3] shmem: implement user/group quota support for tmpfs Lukas Czerner
2022-11-22 15:21   ` kernel test robot
2022-11-22 20:57   ` Brian Foster
2022-11-23  9:01     ` Lukas Czerner
2022-11-23 12:35       ` Brian Foster
2022-11-23 16:37   ` Jan Kara
2022-11-25  8:59     ` Lukas Czerner
2022-11-25  9:14       ` Jan Kara
2022-11-25  9:49         ` Lukas Czerner [this message]
2022-11-21 14:28 ` [PATCH v2 3/3] shmem: implement mount options for global quota limits Lukas Czerner
2022-11-22  6:15   ` kernel test robot
2022-11-22 21:03   ` Brian Foster
2022-11-23  9:38     ` Lukas Czerner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221125094916.4vutvnxt4wiulygw@fedora \
    --to=lczerner@redhat.com \
    --cc=djwong@kernel.org \
    --cc=hughd@google.com \
    --cc=jack@suse.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=sandeen@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox