Re: [PATCH] Fix minor quota race

From: Andrew Morton
Date: Thu Jul 01 2004 - 17:11:53 EST


Jan Kara <jack@xxxxxxx> wrote:
>
> I'm sending one more quota fix - it fixes a possible race between
> quotaoff and prune_icache. The race could lead to some forgotten
> pointers to quotas in inodes leading later to BUG when invalidating
> quota structures. The patch is against 2.6.7.

It tossed one reject against the lock ranking comment in dquot.c. I fixed
that up.

I'll apply the below patch on top of it - please always put extern decls in
header files so that the implementor and all users of the data/function
always see the same declaration.



diff -puN fs/dquot.c~fix-minor-quota-race-tweaks fs/dquot.c
--- 25/fs/dquot.c~fix-minor-quota-race-tweaks Thu Jul 1 15:05:45 2004
+++ 25-akpm/fs/dquot.c Thu Jul 1 15:06:12 2004
@@ -730,11 +730,6 @@ static void put_dquot_list(struct list_h
}
}

-/* Function in inode.c - remove pointers to dquots in icache */
-extern void remove_dquot_ref(struct super_block *, int, struct list_head *);
-
-extern struct semaphore iprune_sem;
-
/* Gather all references from inodes and drop them */
static void drop_dquot_ref(struct super_block *sb, int type)
{
diff -puN include/linux/fs.h~fix-minor-quota-race-tweaks include/linux/fs.h
--- 25/include/linux/fs.h~fix-minor-quota-race-tweaks Thu Jul 1 15:05:45 2004
+++ 25-akpm/include/linux/fs.h Thu Jul 1 15:07:08 2004
@@ -1386,6 +1386,8 @@ extern void clear_inode(struct inode *);
extern void destroy_inode(struct inode *);
extern struct inode *new_inode(struct super_block *);
extern int remove_suid(struct dentry *);
+extern void remove_dquot_ref(struct super_block *, int, struct list_head *);
+extern struct semaphore iprune_sem;

extern void __insert_inode_hash(struct inode *, unsigned long hashval);
extern void remove_inode_hash(struct inode *);
_

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