xfs
[Top] [All Lists]

[PATCH v3 3/3] xfs: Print error when unable to allocate inodes or out of

To: xfs@xxxxxxxxxxx
Subject: [PATCH v3 3/3] xfs: Print error when unable to allocate inodes or out of free inodes.
From: raghu.prabhu13@xxxxxxxxx
Date: Wed, 26 Sep 2012 12:26:49 +0530
Cc: bpm@xxxxxxx, elder@xxxxxxxxxx, david@xxxxxxxxxxxxx, Raghavendra D Prabhu <rprabhu@xxxxxxxxxxx>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :in-reply-to:references; bh=Z2zI3elp/fqupw1W50gk3rHOguDjAYwZawSNAB9XDI4=; b=Po3CYEluD4+naqqUBygJtB5N32o93aGqrDTVQHV7JU1BBFB80TO4vg+Si001zybQY4 uCh9mBlX1uuVlnfnv0KOAW6biWvjbc8KvzyI9wtpLQQ082EdIgO/7U+sT/ssVfKFYB7R Q+p9MZppYf95i6Yrg31OrDgZS+x1GmlYL+z7SzQOGS426ibgEPbKqrnBAmDn2BSfenio miwb19oeUYoiKXDS0J6xGrNKOLVUJbXc+f34RtQWHy7x21ewS29/Xd8EV16lEUfLqzFC 36sMc0USO6DHQfIp23a1BGq4xku61kkkMXnl4G0Vuj6xPNEN+1Q9aztzeOnX6fMVHnkz +D9g==
In-reply-to: <cover.1348639531.git.rprabhu@xxxxxxxxxxx>
In-reply-to: <cover.1348641483.git.rprabhu@xxxxxxxxxxx>
References: <cover.1348639531.git.rprabhu@xxxxxxxxxxx>
References: <cover.1348641483.git.rprabhu@xxxxxxxxxxx>
From: Raghavendra D Prabhu <rprabhu@xxxxxxxxxxx>

When xfs_dialloc is unable to allocate required number of inodes due to global
ceiling, or AGs are out of free inodes but not allowed to allocate inodes or
unable to allocate without continguous free space, printk the error in
ratelimited manner.

Signed-off-by: Raghavendra D Prabhu <rprabhu@xxxxxxxxxxx>
---
 fs/xfs/xfs_ialloc.c | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/fs/xfs/xfs_ialloc.c b/fs/xfs/xfs_ialloc.c
index e75a39d..e9f911b2 100644
--- a/fs/xfs/xfs_ialloc.c
+++ b/fs/xfs/xfs_ialloc.c
@@ -991,7 +991,7 @@ xfs_dialloc(
 
                        xfs_perag_put(pag);
                        *inop = NULLFSINO;
-                       return 0;
+                       goto out_spc;
                }
 
                if (ialloced) {
@@ -1017,7 +1017,7 @@ nextag:
                        agno = 0;
                if (agno == start_agno) {
                        *inop = NULLFSINO;
-                       return noroom ? ENOSPC : 0;
+                       goto out_spc;
                }
        }
 
@@ -1027,6 +1027,28 @@ out_alloc:
 out_error:
        xfs_perag_put(pag);
        return XFS_ERROR(error);
+out_spc:
+       if (noroom) {
+               xfs_err_ratelimited(mp, "Hit global inode ceiling:");
+               error = ENOSPC;
+       } else if (!okalloc) {
+               /*
+                * implies noroom=0 && (!pag->pagi_freecount && !okalloc) for
+                * all pag
+                */
+               xfs_err_ratelimited(mp,
+                       "No AGs with free inodes and allocation not allowed:");
+               error = 0;
+       } else {
+               xfs_err_ratelimited(mp,
+                       "Unable to allocate continguous space for inodes:");
+               error = 0;
+       }
+
+       xfs_err_ratelimited(mp, "Required %d, Current %llu, Maximum %llu",
+               XFS_IALLOC_INODES(mp), mp->m_sb.sb_icount, mp->m_maxicount);
+       return error;
+
 }
 
 /*
-- 
1.7.12.1

<Prev in Thread] Current Thread [Next in Thread>