From: Evgeniy Ivanov Date: Thu, 11 Aug 2011 18:48:26 +0000 (+0400) Subject: Fix ext2 dentry allocation glitch. X-Git-Tag: v3.2.0~365 X-Git-Url: http://zhaoyanbai.com/repos/%22https:/www.google.com/jsapi/static/verify-sign/verify.pl?a=commitdiff_plain;h=13ded5339f327be839b6be8cc3c5c91b32025add;p=minix.git Fix ext2 dentry allocation glitch. When remove dentry, check if cached position is greater than removed one. --- diff --git a/servers/ext2/path.c b/servers/ext2/path.c index a0b6e688d..e87bf8736 100644 --- a/servers/ext2/path.c +++ b/servers/ext2/path.c @@ -608,9 +608,11 @@ int ftype; /* used when ENTER and if (!HAS_COMPAT_FEATURE(ldir_ptr->i_sp, COMPAT_DIR_INDEX)) ldir_ptr->i_flags &= ~EXT2_INDEX_FL; - ldir_ptr->i_last_dpos = pos; - ldir_ptr->i_last_dentry_size = conv2(le_CPU, - dp->d_rec_len); + if (pos < ldir_ptr->i_last_dpos) { + ldir_ptr->i_last_dpos = pos; + ldir_ptr->i_last_dentry_size = + conv2(le_CPU, dp->d_rec_len); + } ldir_ptr->i_update |= CTIME | MTIME; ldir_ptr->i_dirt = DIRTY; /* Now we have cleared dentry, if it's not