linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Roman Anufriev <dotdot@yandex-team.ru>
Cc: Jan Kara <jack@suse.cz>,
	linux-ext4@vger.kernel.org, tytso@mit.edu,
	dmtrmonakhov@yandex-team.ru
Subject: Re: [PATCH 2/2] ext4: export quota journalling mode via sysfs attr quota_mode
Date: Mon, 19 Oct 2020 10:19:27 +0200	[thread overview]
Message-ID: <20201019081927.GA30825@quack2.suse.cz> (raw)
In-Reply-To: <alpine.OSX.2.23.453.2010172056490.87244@dotdot-osx>

On Sat 17-10-20 21:26:37, Roman Anufriev wrote:
> Hi, sorry for the delay.
> 
> On Thu, 15 Oct 2020, Jan Kara wrote:
> 
> > On Thu 15-10-20 14:32:52, Roman Anufriev wrote:
> > > Right now, it is hard to understand what quota journalling type is enabled:
> > > you need to be quite familiar with kernel code and trace it or really
> > > understand what different combinations of fs flags/mount options lead to.
> > > 
> > > This patch exports via sysfs attr /sys/fs/ext4/<disk>/quota_mode current
> > > quota jounalling mode, making it easier to check at a glance/in autotests.
> > > The semantics is similar to ext4 data journalling modes:
> > > 
> > > * journalled - quota accounting and journaling are enabled
> > > * writeback  - quota accounting is enabled, but journalling is disabled
> > > * none       - quota accounting is disabled
> > > * disabled   - kernel compiled without CONFIG_QUOTA feature
> > > 
> > > Signed-off-by: Roman Anufriev <dotdot@yandex-team.ru>
> > > Reviewed-by: Dmitry Monakhov <dmtrmonakhov@yandex-team.ru>
> > 
> > Hum, I'm not sure about this. The state of quota can be found out with
> > "quotaon -p <mntpoint>" (or corresponding quotactl if you need this from
> > C). The only thing you won't learn is journalled / writeback mode and
> > generally you should not care about this although I agree that for fs
> > crash testing purposes you may care. But is that big enough usecase for a
> > new sysfs file when all the information is already available for userspace
> > just not in a convenient form?
> 
> Rationale behind this patch was mainly the addition of an easy way to check
> whether quota journalled or not as this is quite wanted feature in out
> production environment. TBH, I was not sure about sysfs file too, but it
> seemed to me like the most natural place to put it. Maybe if sysfs is an
> overkill - just add printing to dmesg on mount? At least, you'll be able to
> check what quota type you can enable right after mounting.
> 
> > BTW, I've now realized ext4_any_quota_enabled() has actually misleading
> > name in the sysfs file reports wrong information. It is rather
> > ext4_any_quota_may_be_enabled() since presence of QUOTA mount option only
> > says that quotaon(8) will enable quotas if it is run, not that quota
> > accounting is enabled. sb_any_quota_loaded() tells you if accounting is
> > actually enabled or not (however this can change anytime so that's why we
> > use more relaxed checks for the purpose of journal credit estimates).
> 
> My bad! Totally forgot about the case when 'quota' mount option is present
> but quota accounting is not enabled, as our helper-tool around 'quotactl()'
> do remounting+enabling in one go.
> 
> I'll rename the function to smth like 'ext4_quota_capable()' in v2. And if
> printing to dmesg is OK, I'll probably still use this function to print on
> mount what the quota type will be after accounting is enabled.

Yeah, if a message in dmesg is fine for your purposes, I'd rather go with
that than with a sysfs file.

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

  reply	other threads:[~2020-10-19  8:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-15 11:32 [PATCH 1/2] ext4: add helpers for checking whether quota is enabled/journalled Roman Anufriev
2020-10-15 11:32 ` [PATCH 2/2] ext4: export quota journalling mode via sysfs attr quota_mode Roman Anufriev
2020-10-15 13:15   ` Jan Kara
2020-10-17 18:26     ` Roman Anufriev
2020-10-19  8:19       ` Jan Kara [this message]
2020-10-19  9:36         ` Roman Anufriev
2020-10-15 12:24 ` [PATCH 1/2] ext4: add helpers for checking whether quota is enabled/journalled Jan Kara

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=20201019081927.GA30825@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=dmtrmonakhov@yandex-team.ru \
    --cc=dotdot@yandex-team.ru \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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).