Fix releasing of free inode blocks.
authorBen Pfaff <blp@cs.stanford.edu>
Tue, 21 Jun 2005 00:27:03 +0000 (00:27 +0000)
committerBen Pfaff <blp@cs.stanford.edu>
Tue, 21 Jun 2005 00:27:03 +0000 (00:27 +0000)
src/filesys/inode.c

index bd68167baa1c5c4b2bcfd02c73b99c194e102c87..98dd36a1a9e5c62a537b2316d3b67bcd753f796d 100644 (file)
@@ -164,9 +164,12 @@ inode_close (struct inode *inode)
       list_remove (&inode->elem);
 
       /* Deallocate blocks if removed. */
-      if (inode->removed)
-        free_map_release (inode->sector,
-                          bytes_to_sectors (inode->data.length));
+      if (inode->removed) 
+        {
+          free_map_release (inode->sector, 1);
+          free_map_release (inode->data.start,
+                            bytes_to_sectors (inode->data.length)); 
+        }
 
       free (inode); 
     }