]> Zhao Yanbai Git Server - minix.git/commitdiff
Fix ext2 dentry allocation glitch.
authorEvgeniy Ivanov <lolkaantimat@gmail.com>
Thu, 11 Aug 2011 18:48:26 +0000 (22:48 +0400)
committerBen Gras <ben@minix3.org>
Mon, 15 Aug 2011 17:33:51 +0000 (17:33 +0000)
When remove dentry, check if cached position is greater than removed
one.

servers/ext2/path.c

index a0b6e688d0a99d31278a530189c025fdb17e9151..e87bf87369696767ec24cfcbce299e900c8db518 100644 (file)
@@ -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