Skip to content

Commit 05ce7bf

Browse files
committed
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6: quota: Convert __DQUOT_PARANOIA symbol to standard config option
2 parents 27ee896 + 62af9b5 commit 05ce7bf

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

fs/quota/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ config PRINT_QUOTA_WARNING
3333
Note that this behavior is currently deprecated and may go away in
3434
future. Please use notification via netlink socket instead.
3535

36+
config QUOTA_DEBUG
37+
bool "Additional quota sanity checks"
38+
depends on QUOTA
39+
default n
40+
help
41+
If you say Y here, quota subsystem will perform some additional
42+
sanity checks of quota internal structures. If unsure, say N.
43+
3644
# Generic support for tree structured quota files. Selected when needed.
3745
config QUOTA_TREE
3846
tristate

fs/quota/dquot.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@
8080

8181
#include <asm/uaccess.h>
8282

83-
#define __DQUOT_PARANOIA
84-
8583
/*
8684
* There are three quota SMP locks. dq_list_lock protects all lists with quotas
8785
* and quota formats, dqstats structure containing statistics about the lists
@@ -695,7 +693,7 @@ void dqput(struct dquot *dquot)
695693

696694
if (!dquot)
697695
return;
698-
#ifdef __DQUOT_PARANOIA
696+
#ifdef CONFIG_QUOTA_DEBUG
699697
if (!atomic_read(&dquot->dq_count)) {
700698
printk("VFS: dqput: trying to free free dquot\n");
701699
printk("VFS: device %s, dquot of %s %d\n",
@@ -748,7 +746,7 @@ void dqput(struct dquot *dquot)
748746
goto we_slept;
749747
}
750748
atomic_dec(&dquot->dq_count);
751-
#ifdef __DQUOT_PARANOIA
749+
#ifdef CONFIG_QUOTA_DEBUG
752750
/* sanity check */
753751
BUG_ON(!list_empty(&dquot->dq_free));
754752
#endif
@@ -845,7 +843,7 @@ struct dquot *dqget(struct super_block *sb, unsigned int id, int type)
845843
dquot = NULL;
846844
goto out;
847845
}
848-
#ifdef __DQUOT_PARANOIA
846+
#ifdef CONFIG_QUOTA_DEBUG
849847
BUG_ON(!dquot->dq_sb); /* Has somebody invalidated entry under us? */
850848
#endif
851849
out:
@@ -874,15 +872,15 @@ static int dqinit_needed(struct inode *inode, int type)
874872
static void add_dquot_ref(struct super_block *sb, int type)
875873
{
876874
struct inode *inode, *old_inode = NULL;
877-
#ifdef __DQUOT_PARANOIA
875+
#ifdef CONFIG_QUOTA_DEBUG
878876
int reserved = 0;
879877
#endif
880878

881879
spin_lock(&inode_lock);
882880
list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
883881
if (inode->i_state & (I_FREEING|I_CLEAR|I_WILL_FREE|I_NEW))
884882
continue;
885-
#ifdef __DQUOT_PARANOIA
883+
#ifdef CONFIG_QUOTA_DEBUG
886884
if (unlikely(inode_get_rsv_space(inode) > 0))
887885
reserved = 1;
888886
#endif
@@ -907,7 +905,7 @@ static void add_dquot_ref(struct super_block *sb, int type)
907905
spin_unlock(&inode_lock);
908906
iput(old_inode);
909907

910-
#ifdef __DQUOT_PARANOIA
908+
#ifdef CONFIG_QUOTA_DEBUG
911909
if (reserved) {
912910
printk(KERN_WARNING "VFS (%s): Writes happened before quota"
913911
" was turned on thus quota information is probably "
@@ -940,7 +938,7 @@ static int remove_inode_dquot_ref(struct inode *inode, int type,
940938
inode->i_dquot[type] = NULL;
941939
if (dquot) {
942940
if (dqput_blocks(dquot)) {
943-
#ifdef __DQUOT_PARANOIA
941+
#ifdef CONFIG_QUOTA_DEBUG
944942
if (atomic_read(&dquot->dq_count) != 1)
945943
printk(KERN_WARNING "VFS: Adding dquot with dq_count %d to dispose list.\n", atomic_read(&dquot->dq_count));
946944
#endif

0 commit comments

Comments
 (0)