Re: [PATCH v2] xfsprogs: xfs_quota command error message improvement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.)

Thanks,
-Eric



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux