From 0f1dddfb0c993248234e8d31ed19247eb06be536 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Wed, 3 Dec 1997 16:46:21 +0000 Subject: [PATCH] Fixed corruption of the per-group used directories count. It wasn't decremented when directories were removed because rev.1.12 broke the fixup of the i_mode of the inode being removed. --- sys/gnu/ext2fs/ext2_alloc.c | 7 ++++--- sys/gnu/fs/ext2fs/ext2_alloc.c | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/sys/gnu/ext2fs/ext2_alloc.c b/sys/gnu/ext2fs/ext2_alloc.c index 53409f2a2c2..cfd4ac93927 100644 --- a/sys/gnu/ext2fs/ext2_alloc.c +++ b/sys/gnu/ext2fs/ext2_alloc.c @@ -515,6 +515,7 @@ ext2_vfree(pvp, ino, mode) { register struct ext2_sb_info *fs; register struct inode *pip; + register mode_t save_i_mode; pip = VTOI(pvp); fs = pip->i_e2fs; @@ -531,10 +532,10 @@ ext2_vfree(pvp, ino, mode) really like to know what the rationale behind this 'set i_mode to zero to denote an unused inode' is */ - mode = pip->i_mode; - pip->i_mode = mode; - ext2_free_inode(pip); + save_i_mode = pip->i_mode; pip->i_mode = mode; + ext2_free_inode(pip); + pip->i_mode = save_i_mode; return (0); } diff --git a/sys/gnu/fs/ext2fs/ext2_alloc.c b/sys/gnu/fs/ext2fs/ext2_alloc.c index 53409f2a2c2..cfd4ac93927 100644 --- a/sys/gnu/fs/ext2fs/ext2_alloc.c +++ b/sys/gnu/fs/ext2fs/ext2_alloc.c @@ -515,6 +515,7 @@ ext2_vfree(pvp, ino, mode) { register struct ext2_sb_info *fs; register struct inode *pip; + register mode_t save_i_mode; pip = VTOI(pvp); fs = pip->i_e2fs; @@ -531,10 +532,10 @@ ext2_vfree(pvp, ino, mode) really like to know what the rationale behind this 'set i_mode to zero to denote an unused inode' is */ - mode = pip->i_mode; - pip->i_mode = mode; - ext2_free_inode(pip); + save_i_mode = pip->i_mode; pip->i_mode = mode; + ext2_free_inode(pip); + pip->i_mode = save_i_mode; return (0); }