public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: xfs@oss.sgi.com
Subject: [PATCH 9/9] xfs: list_lru_init returns a negative error
Date: Tue, 13 May 2014 18:56:13 +1000	[thread overview]
Message-ID: <1399971373-6242-10-git-send-email-david@fromorbit.com> (raw)
In-Reply-To: <1399971373-6242-1-git-send-email-david@fromorbit.com>

From: Dave Chinner <dchinner@redhat.com>

And we don't invert it properly when initialising the dquot lru
list.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
 fs/xfs/xfs_qm.c | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
index 348e4d2..dc977b6 100644
--- a/fs/xfs/xfs_qm.c
+++ b/fs/xfs/xfs_qm.c
@@ -843,22 +843,17 @@ xfs_qm_init_quotainfo(
 
 	qinf = mp->m_quotainfo = kmem_zalloc(sizeof(xfs_quotainfo_t), KM_SLEEP);
 
-	if ((error = list_lru_init(&qinf->qi_lru))) {
-		kmem_free(qinf);
-		mp->m_quotainfo = NULL;
-		return error;
-	}
+	error = -list_lru_init(&qinf->qi_lru);
+	if (error)
+		goto out_free_qinf;
 
 	/*
 	 * See if quotainodes are setup, and if not, allocate them,
 	 * and change the superblock accordingly.
 	 */
-	if ((error = xfs_qm_init_quotainos(mp))) {
-		list_lru_destroy(&qinf->qi_lru);
-		kmem_free(qinf);
-		mp->m_quotainfo = NULL;
-		return error;
-	}
+	error = xfs_qm_init_quotainos(mp);
+	if (error)
+		goto out_free_lru;
 
 	INIT_RADIX_TREE(&qinf->qi_uquota_tree, GFP_NOFS);
 	INIT_RADIX_TREE(&qinf->qi_gquota_tree, GFP_NOFS);
@@ -918,7 +913,7 @@ xfs_qm_init_quotainfo(
 		qinf->qi_isoftlimit = be64_to_cpu(ddqp->d_ino_softlimit);
 		qinf->qi_rtbhardlimit = be64_to_cpu(ddqp->d_rtb_hardlimit);
 		qinf->qi_rtbsoftlimit = be64_to_cpu(ddqp->d_rtb_softlimit);
- 
+
 		xfs_qm_dqdestroy(dqp);
 	} else {
 		qinf->qi_btimelimit = XFS_QM_BTIMELIMIT;
@@ -935,6 +930,13 @@ xfs_qm_init_quotainfo(
 	qinf->qi_shrinker.flags = SHRINKER_NUMA_AWARE;
 	register_shrinker(&qinf->qi_shrinker);
 	return 0;
+
+out_free_lru:
+	list_lru_destroy(&qinf->qi_lru);
+out_free_qinf:
+	kmem_free(qinf);
+	mp->m_quotainfo = NULL;
+	return error;
 }
 
 
-- 
1.9.0

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  parent reply	other threads:[~2014-05-13  8:56 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-13  8:56 [PATCH 0/9] xfs: error sign fixes for 3.15-rc6 Dave Chinner
2014-05-13  8:56 ` [PATCH 1/9] xfs: xfs_dir_fsync() returns positive errno Dave Chinner
2014-05-13 12:46   ` Jeff Liu
2014-05-13  8:56 ` [PATCH 2/9] xfs: fix incorrect error sign in xfs_file_aio_read Dave Chinner
2014-05-13 12:46   ` Jeff Liu
2014-05-13  8:56 ` [PATCH 3/9] xfs: xfs_commit_metadata returns wrong errno Dave Chinner
2014-05-13 12:48   ` Jeff Liu
2014-05-13  8:56 ` [PATCH 4/9] xfs: correct error sign on COLLAPSE_RANGE errors Dave Chinner
2014-05-13 12:49   ` Jeff Liu
2014-05-13  8:56 ` [PATCH 5/9] xfs: fix wrong errno from xfs_initxattrs Dave Chinner
2014-05-13 12:51   ` Jeff Liu
2014-05-13  8:56 ` [PATCH 6/9] xfs: fix wrong err sign on xfs_set_acl() Dave Chinner
2014-05-13 12:51   ` Jeff Liu
2014-05-13  8:56 ` [PATCH 7/9] xfs: negate mount workqueue init error value Dave Chinner
2014-05-13 12:56   ` Jeff Liu
2014-05-13  8:56 ` [PATCH 8/9] xfs: negate xfs_icsb_init_counters " Dave Chinner
2014-05-13 12:58   ` Jeff Liu
2014-05-13  8:56 ` Dave Chinner [this message]
2014-05-13 13:05   ` [PATCH 9/9] xfs: list_lru_init returns a negative error Jeff Liu
2014-05-14  7:28 ` [PATCH 0/9] xfs: error sign fixes for 3.15-rc6 Jeff Liu
2014-05-14 21:28   ` Dave Chinner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1399971373-6242-10-git-send-email-david@fromorbit.com \
    --to=david@fromorbit.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox