Index: head/lib/libutil/quotafile.c =================================================================== --- head/lib/libutil/quotafile.c +++ head/lib/libutil/quotafile.c @@ -119,6 +119,7 @@ struct group *grp; struct stat st; int qcmd, serrno; + int ufs; if ((qf = calloc(1, sizeof(*qf))) == NULL) return (NULL); @@ -129,15 +130,21 @@ goto error; qf->dev = st.st_dev; qcmd = QCMD(Q_GETQUOTASIZE, quotatype); + ufs = strcmp(fs->fs_vfstype, "ufs") == 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 = hasquota(fs, quotatype, qf->qfname, + sizeof(qf->qfname)); + } if (quotactl(qf->fsname, qcmd, 0, &qf->wordsize) == 0) return (qf); - /* We only check the quota file for ufs */ - if (strcmp(fs->fs_vfstype, "ufs")) { + if (!ufs) { errno = 0; goto error; - } - serrno = hasquota(fs, quotatype, qf->qfname, sizeof(qf->qfname)); - if (serrno == 0) { + } else if (serrno == 0) { errno = EOPNOTSUPP; goto error; }