Commit 62af9b520513d78484f22f874916dfacbc889ce0
1 parent
08261673cb
Exists in
master
and in
7 other branches
quota: Convert __DQUOT_PARANOIA symbol to standard config option
Make __DQUOT_PARANOIA define from the old days a standard config option and turn it off by default. This gets rid of a quota warning about writes before quota is turned on for systems with ext4 root filesystem. Currently there's no way to legally solve this because /etc/mtab has to be written before quota is turned on on most systems. Signed-off-by: Jan Kara <jack@suse.cz>
Showing 2 changed files with 15 additions and 9 deletions Side-by-side Diff
fs/quota/Kconfig
... | ... | @@ -33,6 +33,14 @@ |
33 | 33 | Note that this behavior is currently deprecated and may go away in |
34 | 34 | future. Please use notification via netlink socket instead. |
35 | 35 | |
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 | + | |
36 | 44 | # Generic support for tree structured quota files. Selected when needed. |
37 | 45 | config QUOTA_TREE |
38 | 46 | tristate |
fs/quota/dquot.c
... | ... | @@ -80,8 +80,6 @@ |
80 | 80 | |
81 | 81 | #include <asm/uaccess.h> |
82 | 82 | |
83 | -#define __DQUOT_PARANOIA | |
84 | - | |
85 | 83 | /* |
86 | 84 | * There are three quota SMP locks. dq_list_lock protects all lists with quotas |
87 | 85 | * and quota formats, dqstats structure containing statistics about the lists |
... | ... | @@ -695,7 +693,7 @@ |
695 | 693 | |
696 | 694 | if (!dquot) |
697 | 695 | return; |
698 | -#ifdef __DQUOT_PARANOIA | |
696 | +#ifdef CONFIG_QUOTA_DEBUG | |
699 | 697 | if (!atomic_read(&dquot->dq_count)) { |
700 | 698 | printk("VFS: dqput: trying to free free dquot\n"); |
701 | 699 | printk("VFS: device %s, dquot of %s %d\n", |
... | ... | @@ -748,7 +746,7 @@ |
748 | 746 | goto we_slept; |
749 | 747 | } |
750 | 748 | atomic_dec(&dquot->dq_count); |
751 | -#ifdef __DQUOT_PARANOIA | |
749 | +#ifdef CONFIG_QUOTA_DEBUG | |
752 | 750 | /* sanity check */ |
753 | 751 | BUG_ON(!list_empty(&dquot->dq_free)); |
754 | 752 | #endif |
... | ... | @@ -845,7 +843,7 @@ |
845 | 843 | dquot = NULL; |
846 | 844 | goto out; |
847 | 845 | } |
848 | -#ifdef __DQUOT_PARANOIA | |
846 | +#ifdef CONFIG_QUOTA_DEBUG | |
849 | 847 | BUG_ON(!dquot->dq_sb); /* Has somebody invalidated entry under us? */ |
850 | 848 | #endif |
851 | 849 | out: |
... | ... | @@ -874,7 +872,7 @@ |
874 | 872 | static void add_dquot_ref(struct super_block *sb, int type) |
875 | 873 | { |
876 | 874 | struct inode *inode, *old_inode = NULL; |
877 | -#ifdef __DQUOT_PARANOIA | |
875 | +#ifdef CONFIG_QUOTA_DEBUG | |
878 | 876 | int reserved = 0; |
879 | 877 | #endif |
880 | 878 | |
... | ... | @@ -882,7 +880,7 @@ |
882 | 880 | list_for_each_entry(inode, &sb->s_inodes, i_sb_list) { |
883 | 881 | if (inode->i_state & (I_FREEING|I_CLEAR|I_WILL_FREE|I_NEW)) |
884 | 882 | continue; |
885 | -#ifdef __DQUOT_PARANOIA | |
883 | +#ifdef CONFIG_QUOTA_DEBUG | |
886 | 884 | if (unlikely(inode_get_rsv_space(inode) > 0)) |
887 | 885 | reserved = 1; |
888 | 886 | #endif |
... | ... | @@ -907,7 +905,7 @@ |
907 | 905 | spin_unlock(&inode_lock); |
908 | 906 | iput(old_inode); |
909 | 907 | |
910 | -#ifdef __DQUOT_PARANOIA | |
908 | +#ifdef CONFIG_QUOTA_DEBUG | |
911 | 909 | if (reserved) { |
912 | 910 | printk(KERN_WARNING "VFS (%s): Writes happened before quota" |
913 | 911 | " was turned on thus quota information is probably " |
... | ... | @@ -940,7 +938,7 @@ |
940 | 938 | inode->i_dquot[type] = NULL; |
941 | 939 | if (dquot) { |
942 | 940 | if (dqput_blocks(dquot)) { |
943 | -#ifdef __DQUOT_PARANOIA | |
941 | +#ifdef CONFIG_QUOTA_DEBUG | |
944 | 942 | if (atomic_read(&dquot->dq_count) != 1) |
945 | 943 | printk(KERN_WARNING "VFS: Adding dquot with dq_count %d to dispose list.\n", atomic_read(&dquot->dq_count)); |
946 | 944 | #endif |