aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/configs/ppc6xx_defconfig1
-rw-r--r--arch/powerpc/configs/ps3_defconfig1
-rw-r--r--arch/s390/configs/default_defconfig1
-rw-r--r--arch/sh/configs/rsk7203_defconfig1
-rw-r--r--arch/xtensa/configs/iss_defconfig1
-rw-r--r--arch/xtensa/configs/s6105_defconfig1
-rw-r--r--fs/file_table.c5
-rw-r--r--fs/open.c8
-rw-r--r--include/linux/fs.h49
-rw-r--r--lib/Kconfig.debug10
10 files changed, 0 insertions, 78 deletions
diff --git a/arch/powerpc/configs/ppc6xx_defconfig b/arch/powerpc/configs/ppc6xx_defconfig
index c2353bf059fd..175a8b99c196 100644
--- a/arch/powerpc/configs/ppc6xx_defconfig
+++ b/arch/powerpc/configs/ppc6xx_defconfig
@@ -1244,7 +1244,6 @@ CONFIG_DEBUG_SPINLOCK_SLEEP=y
1244CONFIG_DEBUG_HIGHMEM=y 1244CONFIG_DEBUG_HIGHMEM=y
1245CONFIG_DEBUG_INFO=y 1245CONFIG_DEBUG_INFO=y
1246CONFIG_DEBUG_VM=y 1246CONFIG_DEBUG_VM=y
1247CONFIG_DEBUG_WRITECOUNT=y
1248CONFIG_DEBUG_LIST=y 1247CONFIG_DEBUG_LIST=y
1249CONFIG_DEBUG_SG=y 1248CONFIG_DEBUG_SG=y
1250# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1249# CONFIG_RCU_CPU_STALL_DETECTOR is not set
diff --git a/arch/powerpc/configs/ps3_defconfig b/arch/powerpc/configs/ps3_defconfig
index 139a8308070c..fdee37fab81c 100644
--- a/arch/powerpc/configs/ps3_defconfig
+++ b/arch/powerpc/configs/ps3_defconfig
@@ -174,7 +174,6 @@ CONFIG_DETECT_HUNG_TASK=y
174CONFIG_PROVE_LOCKING=y 174CONFIG_PROVE_LOCKING=y
175CONFIG_DEBUG_LOCKDEP=y 175CONFIG_DEBUG_LOCKDEP=y
176CONFIG_DEBUG_INFO=y 176CONFIG_DEBUG_INFO=y
177CONFIG_DEBUG_WRITECOUNT=y
178CONFIG_DEBUG_MEMORY_INIT=y 177CONFIG_DEBUG_MEMORY_INIT=y
179CONFIG_DEBUG_LIST=y 178CONFIG_DEBUG_LIST=y
180CONFIG_RCU_CPU_STALL_TIMEOUT=60 179CONFIG_RCU_CPU_STALL_TIMEOUT=60
diff --git a/arch/s390/configs/default_defconfig b/arch/s390/configs/default_defconfig
index e0af2ee58751..3f538468a86e 100644
--- a/arch/s390/configs/default_defconfig
+++ b/arch/s390/configs/default_defconfig
@@ -550,7 +550,6 @@ CONFIG_LOCK_STAT=y
550CONFIG_DEBUG_LOCKDEP=y 550CONFIG_DEBUG_LOCKDEP=y
551CONFIG_DEBUG_ATOMIC_SLEEP=y 551CONFIG_DEBUG_ATOMIC_SLEEP=y
552CONFIG_DEBUG_LOCKING_API_SELFTESTS=y 552CONFIG_DEBUG_LOCKING_API_SELFTESTS=y
553CONFIG_DEBUG_WRITECOUNT=y
554CONFIG_DEBUG_LIST=y 553CONFIG_DEBUG_LIST=y
555CONFIG_DEBUG_SG=y 554CONFIG_DEBUG_SG=y
556CONFIG_DEBUG_NOTIFIERS=y 555CONFIG_DEBUG_NOTIFIERS=y
diff --git a/arch/sh/configs/rsk7203_defconfig b/arch/sh/configs/rsk7203_defconfig
index 4e5229b0c5bb..47236573db83 100644
--- a/arch/sh/configs/rsk7203_defconfig
+++ b/arch/sh/configs/rsk7203_defconfig
@@ -128,7 +128,6 @@ CONFIG_DEBUG_MUTEXES=y
128CONFIG_DEBUG_SPINLOCK_SLEEP=y 128CONFIG_DEBUG_SPINLOCK_SLEEP=y
129CONFIG_DEBUG_INFO=y 129CONFIG_DEBUG_INFO=y
130CONFIG_DEBUG_VM=y 130CONFIG_DEBUG_VM=y
131CONFIG_DEBUG_WRITECOUNT=y
132CONFIG_DEBUG_LIST=y 131CONFIG_DEBUG_LIST=y
133CONFIG_DEBUG_SG=y 132CONFIG_DEBUG_SG=y
134CONFIG_FRAME_POINTER=y 133CONFIG_FRAME_POINTER=y
diff --git a/arch/xtensa/configs/iss_defconfig b/arch/xtensa/configs/iss_defconfig
index 4f233204faf9..711f8aa14743 100644
--- a/arch/xtensa/configs/iss_defconfig
+++ b/arch/xtensa/configs/iss_defconfig
@@ -627,7 +627,6 @@ CONFIG_SCHED_DEBUG=y
627# CONFIG_DEBUG_KOBJECT is not set 627# CONFIG_DEBUG_KOBJECT is not set
628# CONFIG_DEBUG_INFO is not set 628# CONFIG_DEBUG_INFO is not set
629# CONFIG_DEBUG_VM is not set 629# CONFIG_DEBUG_VM is not set
630# CONFIG_DEBUG_WRITECOUNT is not set
631# CONFIG_DEBUG_MEMORY_INIT is not set 630# CONFIG_DEBUG_MEMORY_INIT is not set
632# CONFIG_DEBUG_LIST is not set 631# CONFIG_DEBUG_LIST is not set
633# CONFIG_DEBUG_SG is not set 632# CONFIG_DEBUG_SG is not set
diff --git a/arch/xtensa/configs/s6105_defconfig b/arch/xtensa/configs/s6105_defconfig
index d929f77a0360..78318a76fa16 100644
--- a/arch/xtensa/configs/s6105_defconfig
+++ b/arch/xtensa/configs/s6105_defconfig
@@ -569,7 +569,6 @@ CONFIG_DEBUG_SPINLOCK_SLEEP=y
569# CONFIG_DEBUG_INFO is not set 569# CONFIG_DEBUG_INFO is not set
570# CONFIG_DEBUG_VM is not set 570# CONFIG_DEBUG_VM is not set
571CONFIG_DEBUG_NOMMU_REGIONS=y 571CONFIG_DEBUG_NOMMU_REGIONS=y
572# CONFIG_DEBUG_WRITECOUNT is not set
573# CONFIG_DEBUG_MEMORY_INIT is not set 572# CONFIG_DEBUG_MEMORY_INIT is not set
574# CONFIG_DEBUG_LIST is not set 573# CONFIG_DEBUG_LIST is not set
575# CONFIG_DEBUG_SG is not set 574# CONFIG_DEBUG_SG is not set
diff --git a/fs/file_table.c b/fs/file_table.c
index 79ecae62209a..ee20658a0647 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -52,7 +52,6 @@ static void file_free_rcu(struct rcu_head *head)
52static inline void file_free(struct file *f) 52static inline void file_free(struct file *f)
53{ 53{
54 percpu_counter_dec(&nr_files); 54 percpu_counter_dec(&nr_files);
55 file_check_state(f);
56 call_rcu(&f->f_u.fu_rcuhead, file_free_rcu); 55 call_rcu(&f->f_u.fu_rcuhead, file_free_rcu);
57} 56}
58 57
@@ -186,7 +185,6 @@ struct file *alloc_file(struct path *path, fmode_t mode,
186 * that we can do debugging checks at __fput() 185 * that we can do debugging checks at __fput()
187 */ 186 */
188 if ((mode & FMODE_WRITE) && !special_file(path->dentry->d_inode->i_mode)) { 187 if ((mode & FMODE_WRITE) && !special_file(path->dentry->d_inode->i_mode)) {
189 file_take_write(file);
190 WARN_ON(mnt_clone_write(path->mnt)); 188 WARN_ON(mnt_clone_write(path->mnt));
191 } 189 }
192 if ((mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ) 190 if ((mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ)
@@ -213,10 +211,7 @@ static void drop_file_write_access(struct file *file)
213 return; 211 return;
214 212
215 put_write_access(inode); 213 put_write_access(inode);
216 if (file_check_writeable(file) != 0)
217 return;
218 __mnt_drop_write(mnt); 214 __mnt_drop_write(mnt);
219 file_release_write(file);
220} 215}
221 216
222/* the real guts of fput() - releasing the last reference to file 217/* the real guts of fput() - releasing the last reference to file
diff --git a/fs/open.c b/fs/open.c
index 2ed7325f713e..8d0b6adfe7b8 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -683,7 +683,6 @@ static int do_dentry_open(struct file *f,
683 error = __get_file_write_access(inode, f->f_path.mnt); 683 error = __get_file_write_access(inode, f->f_path.mnt);
684 if (error) 684 if (error)
685 goto cleanup_file; 685 goto cleanup_file;
686 file_take_write(f);
687 } 686 }
688 687
689 f->f_mapping = inode->i_mapping; 688 f->f_mapping = inode->i_mapping;
@@ -731,14 +730,7 @@ cleanup_all:
731 fops_put(f->f_op); 730 fops_put(f->f_op);
732 if (f->f_mode & FMODE_WRITE) { 731 if (f->f_mode & FMODE_WRITE) {
733 if (!special_file(inode->i_mode)) { 732 if (!special_file(inode->i_mode)) {
734 /*
735 * We don't consider this a real
736 * mnt_want/drop_write() pair
737 * because it all happenend right
738 * here, so just reset the state.
739 */
740 put_write_access(inode); 733 put_write_access(inode);
741 file_reset_write(f);
742 __mnt_drop_write(f->f_path.mnt); 734 __mnt_drop_write(f->f_path.mnt);
743 } 735 }
744 } 736 }
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 23b2a35d712e..e80659ed78fc 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -769,9 +769,6 @@ static inline int ra_has_index(struct file_ra_state *ra, pgoff_t index)
769 index < ra->start + ra->size); 769 index < ra->start + ra->size);
770} 770}
771 771
772#define FILE_MNT_WRITE_TAKEN 1
773#define FILE_MNT_WRITE_RELEASED 2
774
775struct file { 772struct file {
776 union { 773 union {
777 struct llist_node fu_llist; 774 struct llist_node fu_llist;
@@ -809,9 +806,6 @@ struct file {
809 struct list_head f_tfile_llink; 806 struct list_head f_tfile_llink;
810#endif /* #ifdef CONFIG_EPOLL */ 807#endif /* #ifdef CONFIG_EPOLL */
811 struct address_space *f_mapping; 808 struct address_space *f_mapping;
812#ifdef CONFIG_DEBUG_WRITECOUNT
813 unsigned long f_mnt_write_state;
814#endif
815} __attribute__((aligned(4))); /* lest something weird decides that 2 is OK */ 809} __attribute__((aligned(4))); /* lest something weird decides that 2 is OK */
816 810
817struct file_handle { 811struct file_handle {
@@ -829,49 +823,6 @@ static inline struct file *get_file(struct file *f)
829#define fput_atomic(x) atomic_long_add_unless(&(x)->f_count, -1, 1) 823#define fput_atomic(x) atomic_long_add_unless(&(x)->f_count, -1, 1)
830#define file_count(x) atomic_long_read(&(x)->f_count) 824#define file_count(x) atomic_long_read(&(x)->f_count)
831 825
832#ifdef CONFIG_DEBUG_WRITECOUNT
833static inline void file_take_write(struct file *f)
834{
835 WARN_ON(f->f_mnt_write_state != 0);
836 f->f_mnt_write_state = FILE_MNT_WRITE_TAKEN;
837}
838static inline void file_release_write(struct file *f)
839{
840 f->f_mnt_write_state |= FILE_MNT_WRITE_RELEASED;
841}
842static inline void file_reset_write(struct file *f)
843{
844 f->f_mnt_write_state = 0;
845}
846static inline void file_check_state(struct file *f)
847{
848 /*
849 * At this point, either both or neither of these bits
850 * should be set.
851 */
852 WARN_ON(f->f_mnt_write_state == FILE_MNT_WRITE_TAKEN);
853 WARN_ON(f->f_mnt_write_state == FILE_MNT_WRITE_RELEASED);
854}
855static inline int file_check_writeable(struct file *f)
856{
857 if (f->f_mnt_write_state == FILE_MNT_WRITE_TAKEN)
858 return 0;
859 printk(KERN_WARNING "writeable file with no "
860 "mnt_want_write()\n");
861 WARN_ON(1);
862 return -EINVAL;
863}
864#else /* !CONFIG_DEBUG_WRITECOUNT */
865static inline void file_take_write(struct file *filp) {}
866static inline void file_release_write(struct file *filp) {}
867static inline void file_reset_write(struct file *filp) {}
868static inline void file_check_state(struct file *filp) {}
869static inline int file_check_writeable(struct file *filp)
870{
871 return 0;
872}
873#endif /* CONFIG_DEBUG_WRITECOUNT */
874
875#define MAX_NON_LFS ((1UL<<31) - 1) 826#define MAX_NON_LFS ((1UL<<31) - 1)
876 827
877/* Page cache limit. The filesystems should put that into their s_maxbytes 828/* Page cache limit. The filesystems should put that into their s_maxbytes
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index a48abeac753f..7a0859314bdf 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -1030,16 +1030,6 @@ config DEBUG_BUGVERBOSE
1030 of the BUG call as well as the EIP and oops trace. This aids 1030 of the BUG call as well as the EIP and oops trace. This aids
1031 debugging but costs about 70-100K of memory. 1031 debugging but costs about 70-100K of memory.
1032 1032
1033config DEBUG_WRITECOUNT
1034 bool "Debug filesystem writers count"
1035 depends on DEBUG_KERNEL
1036 help
1037 Enable this to catch wrong use of the writers count in struct
1038 vfsmount. This will increase the size of each file struct by
1039 32 bits.
1040
1041 If unsure, say N.
1042
1043config DEBUG_LIST 1033config DEBUG_LIST
1044 bool "Debug linked list manipulation" 1034 bool "Debug linked list manipulation"
1045 depends on DEBUG_KERNEL 1035 depends on DEBUG_KERNEL