Skip to contentSkip to conversation

Don't double count reserved block changes on UP.

PATCH In review David Chinner 2 participants 2 messages Apr 22, 2008 – Apr 23, 2008 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Don't double count reserved block changes on UP.

Don't double count reserved block changes on UP.

On uniprocessor machines, the incore superblock is used for all in memory accounting of free blocks. in this situation, changes to the reserved block count are accounted twice; once directly and once via xfs_mod_incore_sb(). Seeing as the modification on SMP is done via xfs_mod_incore_sb(), make this the only update mechanism that UP uses as well.

---
 fs/xfs/xfs_fsops.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
fs/xfs/xfs_fsops.c +0 -4
index d3a0f53..c4f7c93 100644
@@ -552,11 +552,8 @@ retry:
 			mp->m_resblks += free;
 			mp->m_resblks_avail += free;
 			fdblks_delta = -free;
-			mp->m_sb.sb_fdblocks = XFS_ALLOC_SET_ASIDE(mp);
 		} else {
 			fdblks_delta = -delta;
-			mp->m_sb.sb_fdblocks =
-				lcounter + XFS_ALLOC_SET_ASIDE(mp);
 			mp->m_resblks = request;
 			mp->m_resblks_avail += delta;
 		}
@@ -587,7 +584,6 @@ out:
 		if (error == ENOSPC)
 			goto retry;
 	}
-
 	return 0;
 }
 
#1 lore raw

Makes sense. Looks good to me.

Quoted 39 lines · David Chinner

Don't double count reserved block changes on UP.

On uniprocessor machines, the incore superblock is used for all in memory accounting of free blocks. in this situation, changes to the reserved block count are accounted twice; once directly and once via xfs_mod_incore_sb(). Seeing as the modification on SMP is done via xfs_mod_incore_sb(), make this the only update mechanism that UP uses as well.

---
 fs/xfs/xfs_fsops.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
fs/xfs/xfs_fsops.c +0 -4
index d3a0f53..c4f7c93 100644
@@ -552,11 +552,8 @@ retry:
 			mp->m_resblks += free;
 			mp->m_resblks_avail += free;
 			fdblks_delta = -free;
-			mp->m_sb.sb_fdblocks = XFS_ALLOC_SET_ASIDE(mp);
 		} else {
 			fdblks_delta = -delta;
-			mp->m_sb.sb_fdblocks =
-				lcounter + XFS_ALLOC_SET_ASIDE(mp);
 			mp->m_resblks = request;
 			mp->m_resblks_avail += delta;
 		}
@@ -587,7 +584,6 @@ out:
 		if (error == ENOSPC)
 			goto retry;
 	}
-
 	return 0;
 }