xfs
[Top] [All Lists]

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

To: xfs@xxxxxxxxxxx
Subject: [PATCH 3/3] XFS: Print error when unable to allocate inodes or out of free inodes.
From: raghu.prabhu13@xxxxxxxxx
Date: Wed, 12 Sep 2012 03:43:24 +0530
Cc: david@xxxxxxxxxxxxx, Raghavendra D Prabhu <rprabhu@xxxxxxxxxxx>, Ben Myers <bpm@xxxxxxx> (supporter:XFS FILESYSTEM), Alex Elder <elder@xxxxxxxxxx> (supporter:XFS FILESYSTEM), linux-kernel@xxxxxxxxxxxxxxx (open list)
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=wqohzvvYe5Jd0elx1ckCs2V+WfXLS6EYjHG8R+4LV5I=; b=Njl2s48F6Yef9xRnQQLs/Z+syMI8Du61LDXTXcIFqR/KvNJe55/mG8cjwU3Gjdlose 8Sj7GniA8bsX2gYp5zHnfZpBgUfVPisd2vAg9ndfZTGYcBkYDWAHpRQAGt5agrkYREva zZfhUWOwgYN5ueRgKv+67r/K1d0W+G+i0uhFIvukFI7V0xkj405NolZuq+G6pXspNC7J N82lo9BA99wVEF1RlHBF7MPgNKIMzx1+qD2tNzyi+FGLQBhC+qmaNKBZe9hjsEm0DnYH fKZhCfrepO2dnI2TncwVNz6h+Em7oDus5LlWayqnLmlosVuXRSy0SXsmL54dY56KR3rI IGwQ==
In-reply-to: <cover.1347396641.git.rprabhu@xxxxxxxxxxx>
In-reply-to: <cover.1347396641.git.rprabhu@xxxxxxxxxxx>
References: <cover.1347396641.git.rprabhu@xxxxxxxxxxx>
References: <cover.1347396641.git.rprabhu@xxxxxxxxxxx>
From: Raghavendra D Prabhu <rprabhu@xxxxxxxxxxx>

When xfs_dialloc is unable to allocate required number of inodes or there are no
AGs with free inodes, printk the error in ratelimited manner.

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

diff --git a/fs/xfs/xfs_ialloc.c b/fs/xfs/xfs_ialloc.c
index e75a39d..034131b 100644
--- a/fs/xfs/xfs_ialloc.c
+++ b/fs/xfs/xfs_ialloc.c
@@ -990,8 +990,11 @@ xfs_dialloc(
                                goto out_error;
 
                        xfs_perag_put(pag);
-                       *inop = NULLFSINO;
-                       return 0;
+
+                       xfs_err_ratelimited(mp,
+                               "Unable to allocate inodes in AG %d: Required 
%d, Current %llu, Maximum %llu",
+                               agno, XFS_IALLOC_INODES(mp), 
mp->m_sb.sb_icount, mp->m_maxicount);
+                       goto out_spc;
                }
 
                if (ialloced) {
@@ -1016,11 +1019,19 @@ nextag:
                if (++agno == mp->m_sb.sb_agcount)
                        agno = 0;
                if (agno == start_agno) {
-                       *inop = NULLFSINO;
-                       return noroom ? ENOSPC : 0;
+                       if (noroom) {
+                               xfs_err_ratelimited(mp,
+                                       "Out of AGs with free inodes: Required 
%d, Current %llu, Maximum %llu",
+                                        XFS_IALLOC_INODES(mp), 
mp->m_sb.sb_icount, mp->m_maxicount);
+                               goto out_spc;
+                       }
+                       return 0;
                }
        }
 
+out_spc:
+       *inop = NULLFSINO;
+       return ENOSPC;
 out_alloc:
        *IO_agbp = NULL;
        return xfs_dialloc_ag(tp, agbp, parent, inop);
-- 
1.7.12

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