linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: xfs@oss.sgi.com
Subject: Re: [PATCH] xfs_quota: fall back silently if XFS_GETNEXTQUOTA fails
Date: Tue, 2 Aug 2016 10:06:24 -0500	[thread overview]
Message-ID: <ee3edb6b-b218-88d5-abef-1b0b76c345ca@sandeen.net> (raw)
In-Reply-To: <20160802122721.GE31492@infradead.org>



On 8/2/16 7:27 AM, Christoph Hellwig wrote:
> On Tue, Aug 02, 2016 at 02:49:00PM +0800, Zorro Lang wrote:
>> After XFS_GETNEXTQUOTA feature has been merged into linux kernel and
>> xfsprogs, xfs_quota use Q_XGETNEXTQUOTA for report and dump, and
>> fall back to old XFS_GETQUOTA ioctl if XFS_GETNEXTQUOTA fails.
>>
>> But when XFS_GETNEXTQUOTA fails, xfs_quota print a warning as
>> "XFS_GETQUOTA: Invalid argument". That's due to kernel can't
>> recognize XFS_GETNEXTQUOTA ioctl and return EINVAL. At this time,
>> the warning is helpless, xfs_quota just need to fall back.
> 
> We'd still want to report other errors, right?

I advised Zorro to do it this way, because -EINVAL can have a few
meanings, and we don't know for sure why we got it.  Could be a
bad cmd, or a bad type, or ...

If it fails, we're going to fall back anyway, so for any other
error we'd print it twice; on the fallback, we'd print the real
unexpected error anyway, so I think the user will get the relevant
information in this case.

But I guess we could do:

+	/* EINVAL is expected for XFS_GETNEXTQUOTA on older kernels */
 	if (xfsquotactl(cmd, dev, type, id, (void *)&d) < 0) {
+		if (errno != ENOENT && errno != ENOSYS && errno != ESRCH &&
+		    (cmd == XFS_GETNEXTQUOTA && errno != EINVAL)

and then change what we print (not perror("XFS_GETQUOTA") in all cases)?

But if we got i.e. EPERM, we'd print the EPERM error twice; once for the
first call, and once for the fallback.  I suppose that'd be ok, but not
sure it's helpful.

-Eric

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

      parent reply	other threads:[~2016-08-02 15:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-02  6:49 [PATCH] xfs_quota: fall back silently if XFS_GETNEXTQUOTA fails Zorro Lang
2016-08-02 12:27 ` Christoph Hellwig
2016-08-02 13:14   ` Zorro Lang
2016-08-02 15:54     ` Eric Sandeen
2016-08-02 15:06   ` Eric Sandeen [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=ee3edb6b-b218-88d5-abef-1b0b76c345ca@sandeen.net \
    --to=sandeen@sandeen.net \
    --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;
as well as URLs for NNTP newsgroup(s).