Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / kernel_patches / patches / invalidate_show-2.4.29.patch
1 Index: linux-2.4.29/fs/inode.c
2 ===================================================================
3 --- linux-2.4.29.orig/fs/inode.c        2005-04-07 18:55:16.732416736 +0300
4 +++ linux-2.4.29/fs/inode.c     2005-04-07 19:16:46.772300864 +0300
5 @@ -670,7 +670,8 @@
6  /*
7   * Invalidate all inodes for a device.
8   */
9 -static int invalidate_list(struct list_head *head, struct super_block * sb, struct list_head * dispose)
10 +static int invalidate_list(struct list_head *head, struct super_block * sb,
11 +                          struct list_head * dispose, int show)
12  {
13         struct list_head *next;
14         int busy = 0, count = 0;
15 @@ -695,6 +696,11 @@
16                         count++;
17                         continue;
18                 }
19 +               if (show)
20 +                       printk(KERN_ERR
21 +                              "inode busy: dev %s:%lu (%p) mode %o count %u\n",
22 +                              kdevname(sb->s_dev), inode->i_ino, inode,
23 +                              inode->i_mode, atomic_read(&inode->i_count));
24                 busy = 1;
25         }
26         /* only unused inodes may be cached with i_count zero */
27 @@ -719,17 +725,17 @@
28   *     If the discard is successful all the inodes have been discarded.
29   */
30   
31 -int invalidate_inodes(struct super_block * sb)
32 +int invalidate_inodes(struct super_block * sb, int show)
33  {
34         int busy;
35         LIST_HEAD(throw_away);
36  
37         spin_lock(&inode_lock);
38 -       busy = invalidate_list(&inode_in_use, sb, &throw_away);
39 -       busy |= invalidate_list(&inode_unused, sb, &throw_away);
40 -       busy |= invalidate_list(&inode_unused_pagecache, sb, &throw_away);
41 -       busy |= invalidate_list(&sb->s_dirty, sb, &throw_away);
42 -       busy |= invalidate_list(&sb->s_locked_inodes, sb, &throw_away);
43 +       busy = invalidate_list(&inode_in_use, sb, &throw_away, show);
44 +       busy |= invalidate_list(&inode_unused, sb, &throw_away, show);
45 +       busy |= invalidate_list(&inode_unused_pagecache, sb, &throw_away, show);
46 +       busy |= invalidate_list(&sb->s_dirty, sb, &throw_away, show);
47 +       busy |= invalidate_list(&sb->s_locked_inodes, sb, &throw_away, show);
48         spin_unlock(&inode_lock);
49  
50         dispose_list(&throw_away);
51 @@ -755,7 +761,7 @@
52                  * hold).
53                  */
54                 shrink_dcache_sb(sb);
55 -               res = invalidate_inodes(sb);
56 +               res = invalidate_inodes(sb, 0);
57                 drop_super(sb);
58         }
59         invalidate_buffers(dev);
60 Index: linux-2.4.29/fs/super.c
61 ===================================================================
62 --- linux-2.4.29.orig/fs/super.c        2005-04-07 18:53:30.978493776 +0300
63 +++ linux-2.4.29/fs/super.c     2005-04-07 19:14:26.187672976 +0300
64 @@ -844,7 +844,7 @@
65         lock_super(sb);
66         lock_kernel();
67         sb->s_flags &= ~MS_ACTIVE;
68 -       invalidate_inodes(sb);  /* bad name - it should be evict_inodes() */
69 +       invalidate_inodes(sb, 0);  /* bad name - it should be evict_inodes() */
70         if (sop) {
71                 if (sop->write_super && sb->s_dirt)
72                         sop->write_super(sb);
73 @@ -853,7 +853,7 @@
74         }
75  
76         /* Forget any remaining inodes */
77 -       if (invalidate_inodes(sb)) {
78 +       if (invalidate_inodes(sb, 1)) {
79                 printk(KERN_ERR "VFS: Busy inodes after unmount. "
80                         "Self-destruct in 5 seconds.  Have a nice day...\n");
81         }
82 Index: linux-2.4.29/include/linux/fs.h
83 ===================================================================
84 --- linux-2.4.29.orig/include/linux/fs.h        2005-04-07 19:14:06.319693368 +0300
85 +++ linux-2.4.29/include/linux/fs.h     2005-04-07 19:14:26.190672520 +0300
86 @@ -1286,7 +1286,7 @@
87  extern int get_buffer_flushtime(void);
88  extern void balance_dirty(void);
89  extern int check_disk_change(kdev_t);
90 -extern int invalidate_inodes(struct super_block *);
91 +extern int invalidate_inodes(struct super_block *, int);
92  extern int invalidate_device(kdev_t, int);
93  extern void invalidate_inode_pages(struct inode *);
94  extern void invalidate_inode_pages2(struct address_space *);
95 Index: linux-2.4.29/fs/smbfs/inode.c
96 ===================================================================
97 --- linux-2.4.29.orig/fs/smbfs/inode.c  2005-04-07 18:52:37.889564520 +0300
98 +++ linux-2.4.29/fs/smbfs/inode.c       2005-04-07 19:14:26.192672216 +0300
99 @@ -175,7 +175,7 @@
100  {
101         VERBOSE("\n");
102         shrink_dcache_sb(SB_of(server));
103 -       invalidate_inodes(SB_of(server));
104 +       invalidate_inodes(SB_of(server), 0);
105  }
106  
107  /*