linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Christoph Hellwig <hch@infradead.org>
Cc: Jan Kara <jack@suse.cz>, Sascha Hauer <s.hauer@pengutronix.de>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel@pengutronix.de, Jan Kara <jack@suse.com>,
	Richard Weinberger <richard@nod.at>
Subject: Re: [PATCH 1/2] quota: Add mountpath based quota support
Date: Thu, 4 Feb 2021 13:53:50 +0100	[thread overview]
Message-ID: <20210204125350.GD20183@quack2.suse.cz> (raw)
In-Reply-To: <20210204073414.GA126863@infradead.org>

On Thu 04-02-21 07:34:14, Christoph Hellwig wrote:
> On Tue, Feb 02, 2021 at 07:02:41PM +0100, Jan Kara wrote:
> > Hum, let me think out loud. The path we pass to Q_QUOTAON is a path to
> > quota file - unless the filesystem stores quota in hidden files in which
> > case this argument is just ignored. You're right we could require that
> > specifically for Q_QUOTAON, the mountpoint path would actually need to
> > point to the quota file if it is relevant, otherwise anywhere in the
> > appropriate filesystem. We don't allow quota file to reside on a different
> > filesystem (for a past decade or so) so it should work fine.
> > 
> > So the only problem I have is whether requiring the mountpoint argument to
> > point quota file for Q_QUOTAON isn't going to be somewhat confusing to
> > users. At the very least it would require some careful explanation in the
> > manpage to explain the difference between quotactl_path() and quotactl()
> > in this regard. But is saving the second path for Q_QUOTAON really worth the
> > bother?
> 
> I find the doubled path argument a really horrible API, so I'd pretty
> strongly prefer to avoid that.

Honestly, I don't understand why is it so horrible. The paths point to
different things... The first path identifies the filesystem to operate on,
the second path identifies the file which contains quota accounting data.
In the ancient times, the file with quota accounting data could even be
stored on a different filesystem (these were still times when filesystem
metadata journalling was a new thing - like late 90's).  But later I just
disallowed that because it was not very useful (and luckily even used) and
just complicated matters.
 
Anyway, back to 2021 :). What I find somewhat confusing about a single path
for Q_QUOTAON is that for any other quotactl, any path on the filesystem is
fine. Similarly if quota data is stored in the hidden file, any path on the
filesystem is fine. It is only for Q_QUOTAON on a filesystem where quota
data is stored in a normal file, where we suddently require that the path
has to point to it.

Now quota data stored in a normal file is a setup we try to deprecate
anyway so another option is to just leave quotactl_path() only for those
setups where quota metadata is managed by the filesystem so we don't need
to pass quota files to Q_QUOTAON?

> > > Given how cheap quotactl_cmd_onoff and quotactl_cmd_write are we
> > > could probably simplify this down do:
> > > 
> > > 	if (quotactl_cmd_write(cmd)) {
> > 
> > This needs to be (quotactl_cmd_write(cmd) || quotactl_cmd_onoff(cmd)).
> > Otherwise I agree what you suggest is somewhat more readable given how
> > small the function is.
> 
> The way I read quotactl_cmd_write, it only special cases a few commands
> and returns 0 there, so we should not need the extra quotactl_cmd_onoff
> call, as all those commands are not explicitly listed.

Right, sorry, I was mistaken.

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

  reply	other threads:[~2021-02-04 12:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-28 14:17 [PATCH 0/2] quota: Add mountpath based quota support Sascha Hauer
2021-01-28 14:17 ` [PATCH 1/2] " Sascha Hauer
2021-01-28 14:35   ` Christoph Hellwig
2021-02-02 18:02     ` Jan Kara
2021-02-04  7:34       ` Christoph Hellwig
2021-02-04 12:53         ` Jan Kara [this message]
2021-02-09  8:51           ` Christoph Hellwig
2021-02-09  9:57             ` Jan Kara
2021-01-28 14:17 ` [PATCH 2/2] quota: wire up quotactl_path Sascha Hauer
2021-01-28 14:17 ` [PATCH] quotactl.2: Add documentation for quotactl_path() Sascha Hauer
2021-02-11 15:30 [PATCH v2 0/2] quota: Add mountpath based quota support Sascha Hauer
2021-02-11 15:30 ` [PATCH 1/2] " Sascha Hauer
2021-02-11 15:38   ` Christoph Hellwig
2021-02-12  8:38     ` Sascha Hauer
2021-02-12 10:05       ` Jan Kara
2021-02-12 10:29         ` Sascha Hauer
2021-02-12 10:41           ` Jan Kara
2021-02-12  5:45   ` kernel test robot
2021-02-14 13:48   ` Al Viro
2021-03-04 12:35 [PATCH v3 0/2] " Sascha Hauer
2021-03-04 12:35 ` [PATCH 1/2] " Sascha Hauer

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=20210204125350.GD20183@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=hch@infradead.org \
    --cc=jack@suse.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=richard@nod.at \
    --cc=s.hauer@pengutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).