Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Feb 2019 14:00:48 -0800
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        Sean Eric Fagan <sef@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r343881 - head/lib/libutil
Message-ID:  <5ff60936-45d0-3aa8-0b1b-e937e5639da4@FreeBSD.org>
In-Reply-To: <201902072151.x17Lpdok089600@repo.freebsd.org>
References:  <201902072151.x17Lpdok089600@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--SFojDR4AseoYI3eXnL3yNdbd0WjzVvtfO
Content-Type: multipart/mixed; boundary="AGmTCOVb2l7uCpbLmRJQUtoaPtxAvk8Rm";
 protected-headers="v1"
From: Bryan Drewery <bdrewery@FreeBSD.org>
To: Sean Eric Fagan <sef@FreeBSD.org>, src-committers@freebsd.org,
 svn-src-all@freebsd.org, svn-src-head@freebsd.org
Message-ID: <5ff60936-45d0-3aa8-0b1b-e937e5639da4@FreeBSD.org>
Subject: Re: svn commit: r343881 - head/lib/libutil
References: <201902072151.x17Lpdok089600@repo.freebsd.org>
In-Reply-To: <201902072151.x17Lpdok089600@repo.freebsd.org>

--AGmTCOVb2l7uCpbLmRJQUtoaPtxAvk8Rm
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable

On 2/7/19 1:51 PM, Sean Eric Fagan wrote:
> Author: sef
> Date: Thu Feb  7 21:51:39 2019
> New Revision: 343881
> URL: https://svnweb.freebsd.org/changeset/base/343881
>=20
> Log:
>   r339008 broke repquota for UFS.  This rectifies that.
>  =20
>   Refactor the function calls and tests so that, on UFS, the proper fie=
lds
>   are filled out.
>  =20
>   PR:		233849
>   Reported by:	Andre Albsmeier
>   Reviewed by:	mav, delphij
>   MFC after:	1 month
>   Sponsored by:	iXsystems Inc
>   Differential Revision:	https://reviews.freebsd.org/D18785
>=20
> Modified:
>   head/lib/libutil/quotafile.c
>=20
> Modified: head/lib/libutil/quotafile.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/lib/libutil/quotafile.c	Thu Feb  7 21:41:27 2019	(r343880)
> +++ head/lib/libutil/quotafile.c	Thu Feb  7 21:51:39 2019	(r343881)
> @@ -119,6 +119,7 @@ quota_open(struct fstab *fs, int quotatype, int ope=
nfl
>  	struct group *grp;
>  	struct stat st;
>  	int qcmd, serrno;
> +	int ufs;
> =20
>  	if ((qf =3D calloc(1, sizeof(*qf))) =3D=3D NULL)
>  		return (NULL);
> @@ -129,15 +130,21 @@ quota_open(struct fstab *fs, int quotatype, int o=
penfl
>  		goto error;
>  	qf->dev =3D st.st_dev;
>  	qcmd =3D QCMD(Q_GETQUOTASIZE, quotatype);
> +	ufs =3D strcmp(fs->fs_vfstype, "ufs") =3D=3D 0;
> +	/*
> +	 * On UFS, hasquota() fills in qf->qfname. But we only care about
> +	 * this for UFS.  So we need to call hasquota() for UFS, first.
> +	 */
> +	if (ufs) {
> +		serrno =3D hasquota(fs, quotatype, qf->qfname,
> +		    sizeof(qf->qfname));
> +	}
>  	if (quotactl(qf->fsname, qcmd, 0, &qf->wordsize) =3D=3D 0)
>  		return (qf);
> -	/* We only check the quota file for ufs */
> -	if (strcmp(fs->fs_vfstype, "ufs")) {
> +	if (!ufs) {
>  		errno =3D 0;
>  		goto error;
> -	}
> -	serrno =3D hasquota(fs, quotatype, qf->qfname, sizeof(qf->qfname));
> -	if (serrno =3D=3D 0) {
> +	} else if (serrno =3D=3D 0) {
>  		errno =3D EOPNOTSUPP;
>  		goto error;
>  	}
>=20

/usr/src/lib/libutil/quotafile.c:121: warning: 'serrno' may be used
uninitialized in this function

--=20
Regards,
Bryan Drewery


--AGmTCOVb2l7uCpbLmRJQUtoaPtxAvk8Rm--

--SFojDR4AseoYI3eXnL3yNdbd0WjzVvtfO
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEE+Rc8ssOq6npcih8JNddxu25Gl88FAlxcqpEACgkQNddxu25G
l89rLwf/aJEccgXhp/U3vGVYi/YZ53GKi2/0icwxZRtLb6E0QTetfeP6mLH6qJyM
KJrVwe9V4zBaYbG2S54PUH0OsleM9r8HUkBD1tECdme4Cbq3brHmfoo4LJqmEBcU
eZVwMi68Ri/CI+3Ht4yG8vxPnn/TJ0QzbvbfKlOtiKtu8fs5Kn0LE9JhaTK3RVX5
NVDDnv7pGLEBQeVNf4USL2EsRCyYrWcJbpiN2YoBN/0HZClEEWm1CENRKMNcdST8
AmQZP7g8pIX3nZWjT3774VsFQ80TC8vQ1J3MzciTrwO2hKg90pJcloYm9iZR4ovx
smP/GwAkA8eNmU6SDjxSsQunikIgzA==
=r49E
-----END PGP SIGNATURE-----

--SFojDR4AseoYI3eXnL3yNdbd0WjzVvtfO--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5ff60936-45d0-3aa8-0b1b-e937e5639da4>