Blob Blame Raw
From 6ba6546dd167297cb9ed69d0257ee245b0faea47 Mon Sep 17 00:00:00 2001
From: Jan Kara <jack@suse.cz>
Date: Fri, 8 Jun 2012 11:11:20 +0200
Subject: [PATCH 2/2] repquota: Fix reporting for XFS

Conversion to generic quota scanning introduced a bug for XFS where we
stopped scanning after quotactl reported first error. quotactl for XFS
however reports ENOENT when it has nothing to report for a particular user
/ group and we shouldn't stop scanning after that. We tried to test for this
but the test was wrong. Fix it.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 quotaio_xfs.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/quotaio_xfs.c b/quotaio_xfs.c
index 2e879e6..903c03e 100644
--- a/quotaio_xfs.c
+++ b/quotaio_xfs.c
@@ -183,9 +183,9 @@ static int xfs_get_dquot(struct dquot *dq)
 	memset(&d, 0, sizeof(d));
 	ret = quotactl(qcmd, dq->dq_h->qh_quotadev, dq->dq_id, (void *)&d);
 	if (ret < 0) {
-		if (ret == -ENOENT)
+		if (errno == ENOENT)
 			return 0;
-		return ret;
+		return -1;
 	}
 	xfs_kern2utildqblk(&dq->dq_dqb, &d);
 	return 0;
-- 
1.7.7.6