From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 3/3] xfs: implement quota warnings via netlink
Date: Thu, 14 Jan 2010 12:19:48 +1100 [thread overview]
Message-ID: <20100114011948.GV17483@discord.disaster> (raw)
In-Reply-To: <20100113220603.251930871@bombadil.infradead.org>
On Wed, Jan 13, 2010 at 05:05:50PM -0500, Christoph Hellwig wrote:
> Wire up quota_send_warning to send quota warnings over netlink. This is
> used by various desktops to show user quota warnings.
A couple of comments below.
> Tested by running the quota_nld daemon while running the xfstest quota
> tests and observing the warnings. I'll see how I can get a more formal
> testcase for it written.
Sounds like it needs something similar to the dmapi event listeners
we use for testing that the dmapi events are generated correctly....
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
>
> Index: xfs/fs/xfs/quota/xfs_trans_dquot.c
> ===================================================================
> --- xfs.orig/fs/xfs/quota/xfs_trans_dquot.c 2010-01-13 13:51:20.925003101 +0100
> +++ xfs/fs/xfs/quota/xfs_trans_dquot.c 2010-01-13 14:10:46.083254517 +0100
> @@ -589,6 +589,20 @@ xfs_trans_unreserve_and_mod_dquots(
> }
> }
>
> +STATIC void
> +xfs_quota_send_warning(
> + struct xfs_mount *mp,
> + struct xfs_dquot *dqp,
> + int hard)
> +{
> + /* no warnings for project quotas - we just return ENOSPC later */
> + if (dqp->dq_flags & XFS_DQ_PROJ)
> + return;
> + quota_send_warning((dqp->dq_flags & XFS_DQ_USER) ? USRQUOTA : GRPQUOTA,
> + be32_to_cpu(dqp->q_core.d_id), mp->m_super->s_dev,
> + hard ? QUOTA_NL_BHARDWARN: QUOTA_NL_BSOFTWARN);
> +}
This appears to send "over block quota" warnings even when
the error is caused by the number of inodes going over limit.
For inode count warnings we should be sending QUOTA_NL_IHARDWARN or
QUOTA_NL_ISOFTWARN. That could be easily done if the "hard"
parameter is changed to the type of warning which is set up
in the calling function.
We could probably even return the grace limit expired versions
as well when over the soft limits with a slight change to the
soft limit warning logic as well...
> +
> /*
> * This reserves disk blocks and inodes against a dquot.
> * Flags indicate if the dquot is to be locked here and also
> @@ -612,6 +626,7 @@ xfs_trans_dqresv(
> xfs_qcnt_t count;
> xfs_qcnt_t *resbcountp;
> xfs_quotainfo_t *q = mp->m_quotainfo;
> + int hardwarn = 0;
As mentioned above, this should probably be a "warn_type"
parameter rather than a boolean hard/soft warning flag.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2010-01-14 1:19 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-13 22:05 [PATCH 0/3] small quota updates for 2.6.34 Christoph Hellwig
2010-01-13 22:05 ` [PATCH 1/3] xfs: kill XFS_QMOPT_ASYNC Christoph Hellwig
2010-01-14 0:47 ` Dave Chinner
2010-01-14 18:59 ` Alex Elder
2010-01-13 22:05 ` [PATCH 2/3] xfs: clean up error handling in xfs_trans_dqresv Christoph Hellwig
2010-01-14 0:53 ` Dave Chinner
2010-01-13 22:05 ` [PATCH 3/3] xfs: implement quota warnings via netlink Christoph Hellwig
2010-01-14 1:19 ` Dave Chinner [this message]
2010-01-14 6:42 ` Christoph Hellwig
2010-01-17 22:36 ` [PATCH 3/3 v2] " Christoph Hellwig
2010-01-18 11:03 ` Dave Chinner
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=20100114011948.GV17483@discord.disaster \
--to=david@fromorbit.com \
--cc=hch@infradead.org \
--cc=xfs@oss.sgi.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