From: Bill O'Donnell <billodo@redhat.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH v2] xfsprogs: xfs_quota command error message improvement
Date: Tue, 23 Jun 2020 18:07:55 -0500 [thread overview]
Message-ID: <20200623230755.GA131402@redhat.com> (raw)
In-Reply-To: <a2c5d616-c48a-435e-e3b4-4d6c784d4a2d@sandeen.net>
On Tue, Jun 23, 2020 at 05:30:38PM -0500, Eric Sandeen wrote:
> On 6/22/20 8:13 AM, Bill O'Donnell wrote:
> > @@ -350,8 +365,15 @@ quotaoff(
> > return;
> > }
> > dir = mount->fs_name;
> > - if (xfsquotactl(XFS_QUOTAOFF, dir, type, 0, (void *)&qflags) < 0)
> > - perror("XFS_QUOTAOFF");
> > + if (xfsquotactl(XFS_QUOTAOFF, dir, type, 0, (void *)&qflags) < 0) {
> > + if (errno == EEXIST)
> > + fprintf(stderr, _("Quota already off.\n"));
> > + else if (errno == EINVAL)
> > + fprintf(stderr,
> > + _("Can't disable when quotas are off.\n"));
>
> Is this the right message here? We get here from off_f(), which disables
> enforcement and accounting, so I'm not sure "can't disable" makes sense
> if "disable" means "disable enforcement" as it did in disable_enforcement()...?
>
> (IOWs, have can you provoke EINVAL? How? Sorry, this just kind of jumps out
> at me because "can't disable" seems a little out of place in quotaoff() so
> I want to double check.)
You're right. It was a copy/paste from the disable case. You also have a good point
in that I don't think EINVAL is ever provoked for the OFF case. I'll recheck it.
Thanks-
Bill
>
> Thanks,
> -Eric
>
prev parent reply other threads:[~2020-06-23 23:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-22 13:13 [PATCH v2] xfsprogs: xfs_quota command error message improvement Bill O'Donnell
2020-06-22 15:33 ` Darrick J. Wong
2020-06-23 22:30 ` Eric Sandeen
2020-06-23 23:07 ` Bill O'Donnell [this message]
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=20200623230755.GA131402@redhat.com \
--to=billodo@redhat.com \
--cc=linux-xfs@vger.kernel.org \
--cc=sandeen@sandeen.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.