xfs-masters
[Top] [All Lists]

[Bug 887] over max icount inode allocation

To: xfs-masters@xxxxxxxxxxx
Subject: [Bug 887] over max icount inode allocation
From: bugzilla-daemon@xxxxxxxxxxx
Date: Fri, 16 Jul 2010 10:35:56 -0500
Auto-submitted: auto-generated
In-reply-to: <bug-887-113@xxxxxxxxxxxxxxxx/bugzilla/>
References: <bug-887-113@xxxxxxxxxxxxxxxx/bugzilla/>
http://oss.sgi.com/bugzilla/show_bug.cgi?id=887





--- Comment #1 from sbrodsky@xxxxxxx  2010-07-16 10:35:55 CST ---
This is a proposed patch for the over maxicount negative stats bug.  This
solves the delayed update if the icount and should not be a performance issue
since it the inode allocation is done at create time.

Index: sbrodsky/TOT/xfs/fs/xfs/xfs_ialloc.c
===================================================================
--- sbrodsky.orig/TOT/xfs/fs/xfs/xfs_ialloc.c   2010-07-16 10:12:02.000000000
-0500
+++ sbrodsky/TOT/xfs/fs/xfs/xfs_ialloc.c        2010-07-16 10:19:56.312633030
-0500
@@ -260,7 +260,7 @@
         */
        newlen = XFS_IALLOC_INODES(args.mp);
        if (args.mp->m_maxicount &&
-           args.mp->m_sb.sb_icount + newlen > args.mp->m_maxicount)
+           atomic64_read(&args.mp->m_inodesinuse) + newlen >
args.mp->m_maxicount)
                return XFS_ERROR(ENOSPC);
        args.minlen = args.maxlen = XFS_IALLOC_BLOCKS(args.mp);
        /*
@@ -708,7 +708,7 @@
         */

        if (mp->m_maxicount &&
-       +           atomic64_read(&mp->m_inodesinuse) + XFS_IALLOC_INODES(mp) >
mp->m_maxicount)
                noroom = 1;
                okalloc = 0;
        }
Index: sbrodsky/TOT/xfs/fs/xfs/xfs_mount.c
===================================================================
--- sbrodsky.orig/TOT/xfs/fs/xfs/xfs_mount.c    2010-07-16 10:12:02.000000000
-0500
+++ sbrodsky/TOT/xfs/fs/xfs/xfs_mount.c 2010-07-16 10:20:49.717572132 -0500
@@ -744,6 +744,7 @@
        mp->m_blockmask = sbp->sb_blocksize - 1;
        mp->m_blockwsize = sbp->sb_blocksize >> XFS_WORDLOG;
        mp->m_blockwmask = mp->m_blockwsize - 1;
+       atomic64_set(&mp->m_inodesinuse,sbp->sb_icount);

        mp->m_alloc_mxr[0] = xfs_allocbt_maxrecs(mp, sbp->sb_blocksize, 1);
        mp->m_alloc_mxr[1] = xfs_allocbt_maxrecs(mp, sbp->sb_blocksize, 0);
Index: sbrodsky/TOT/xfs/fs/xfs/xfs_mount.h
===================================================================
--- sbrodsky.orig/TOT/xfs/fs/xfs/xfs_mount.h    2010-07-16 10:12:02.000000000
-0500
+++ sbrodsky/TOT/xfs/fs/xfs/xfs_mount.h 2010-07-16 10:21:36.377577685 -0500
@@ -137,6 +137,7 @@
        __uint8_t               m_agno_log;     /* log #ag's */
        __uint8_t               m_agino_log;    /* #bits for agino in inum */
        __uint16_t              m_inode_cluster_size;/* min inode buf size */
+       atomic64_t              m_inodesinuse;  /* in use inode allocations */
        uint                    m_blockmask;    /* sb_blocksize-1 */
        uint                    m_blockwsize;   /* sb_blocksize in words */
        uint                    m_blockwmask;   /* blockwsize-1 */
Index: sbrodsky/TOT/xfs/fs/xfs/xfs_trans.c
===================================================================
--- sbrodsky.orig/TOT/xfs/fs/xfs/xfs_trans.c    2010-07-16 10:12:02.000000000
-0500
+++ sbrodsky/TOT/xfs/fs/xfs/xfs_trans.c 2010-07-16 10:22:47.690249548 -0500
@@ -805,6 +805,7 @@
        switch (field) {
        case XFS_TRANS_SB_ICOUNT:
                tp->t_icount_delta += delta;
+               atomic64_add(delta,&tp->t_mountp->m_inodesinuse);
                if (xfs_sb_version_haslazysbcount(&mp->m_sb))
                        flags &= ~XFS_TRANS_SB_DIRTY;
                break;

-- 
Configure bugmail: http://oss.sgi.com/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

<Prev in Thread] Current Thread [Next in Thread>
  • [Bug 887] over max icount inode allocation, bugzilla-daemon <=