From: Zorro Lang Date: Thu, 4 Aug 2016 01:29:49 +0000 (+1000) Subject: xfs_quota: fall back silently if XFS_GETNEXTQUOTA fails X-Git-Tag: v4.7.0~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=52e81d72272a00c692cb6fdaa49df8b59a539c50;p=thirdparty%2Fxfsprogs-dev.git xfs_quota: fall back silently if XFS_GETNEXTQUOTA fails 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. Signed-off-by: Zorro Lang Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner --- diff --git a/quota/report.c b/quota/report.c index 59290e198..70220b44d 100644 --- a/quota/report.c +++ b/quota/report.c @@ -90,8 +90,10 @@ dump_file( else cmd = XFS_GETQUOTA; + /* Fall back silently if XFS_GETNEXTQUOTA fails, warn on XFS_GETQUOTA */ if (xfsquotactl(cmd, dev, type, id, (void *)&d) < 0) { - if (errno != ENOENT && errno != ENOSYS && errno != ESRCH) + if (errno != ENOENT && errno != ENOSYS && errno != ESRCH && + cmd == XFS_GETQUOTA) perror("XFS_GETQUOTA"); return 0; } @@ -347,8 +349,10 @@ report_mount( else cmd = XFS_GETQUOTA; + /* Fall back silently if XFS_GETNEXTQUOTA fails, warn on XFS_GETQUOTA*/ if (xfsquotactl(cmd, dev, type, id, (void *)&d) < 0) { - if (errno != ENOENT && errno != ENOSYS && errno != ESRCH) + if (errno != ENOENT && errno != ENOSYS && errno != ESRCH && + cmd == XFS_GETQUOTA) perror("XFS_GETQUOTA"); return 0; }