Re: Quota fix in 2.2.14 (fwd)

From: Andrea Arcangeli (andrea@suse.de)
Date: Fri Jan 07 2000 - 11:44:27 EST


On Fri, 7 Jan 2000, Jan Kara wrote:

> I was announced about one bug in quota - somebody deleted select_dcache()
>from get_empty_dquot() and didn't change other code properly :|.

Because it isn't necessary.

>The fix is attached.

>--- linux/fs/dquot.c Tue Jan 4 19:12:23 2000
>+++ linux/fs/dquot.c Fri Jan 7 15:47:26 2000
>@@ -569,8 +569,9 @@
> /*
> * Try pruning the dcache to free up some dquots ...
> */
>- printk(KERN_DEBUG "get_empty_dquot: pruning %d\n", count);
>- if (prune_dcache(0, 128))
>+ count = prune_dcache(0, 128);
>+ printk(KERN_DEBUG "get_empty_dquot: pruning dcache (got %d inodes)\n", count);
>+ if (count)
> {
> free_inode_memory(count);
> goto repeat;

Your changes doesn't fix anything. There's none bug there.

The parameter to free_inode_memory means nothing and it's unused, that's
why I am passing to free_inode_memory an unused variable too.

What you probably want to do is to cleanup the code (for eyes only) doing
something like this:

--- 2.2.14-inodecleanup/fs/inode.c.~1~ Wed Jan 5 14:16:55 2000
+++ 2.2.14-inodecleanup/fs/inode.c Fri Jan 7 17:38:23 2000
@@ -435,7 +435,7 @@
  * This is the externally visible routine for
  * inode memory management.
  */
-void free_inode_memory(int goal)
+void free_inode_memory(void)
 {
         spin_lock(&inode_lock);
         free_inodes();
--- 2.2.14-inodecleanup/fs/dquot.c.~1~ Wed Jan 5 14:16:55 2000
+++ 2.2.14-inodecleanup/fs/dquot.c Fri Jan 7 17:38:09 2000
@@ -539,7 +539,6 @@
 struct dquot *get_empty_dquot(void)
 {
         struct dquot *dquot;
- int count;
 
 repeat:
         dquot = find_best_free();
@@ -569,10 +568,10 @@
         /*
          * Try pruning the dcache to free up some dquots ...
          */
- printk(KERN_DEBUG "get_empty_dquot: pruning %d\n", count);
+ printk(KERN_DEBUG "get_empty_dquot: pruning\n");
         if (prune_dcache(0, 128))
         {
- free_inode_memory(count);
+ free_inode_memory();
                 goto repeat;
         }
 
--- 2.2.14-inodecleanup/include/linux/dcache.h.~1~ Wed Jan 5 14:16:56 2000
+++ 2.2.14-inodecleanup/include/linux/dcache.h Fri Jan 7 17:38:28 2000
@@ -143,7 +143,7 @@
 /* dcache memory management */
 extern void shrink_dcache_memory(int, unsigned int);
 extern void check_dcache_memory(void);
-extern void free_inode_memory(int); /* defined in fs/inode.c */
+extern void free_inode_memory(void); /* defined in fs/inode.c */
 
 /* only used at mount-time */
 extern struct dentry * d_alloc_root(struct inode * root_inode, struct dentry * old_root);

But again, the above is _only_ a code cleanup and won't change the
beahviour of the kernel so none user needs to apply the above patch on the
top of 2.2.14.

Andrea

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jan 07 2000 - 21:00:09 EST