Whamcloud - gitweb
b=4336
[fs/lustre-release.git] / lustre / kernel_patches / patches / invalidate_show_2.4.20_chaos.patch
1  fs/inode.c         |   21 ++++++++++++++-------
2  fs/smbfs/inode.c   |    2 +-
3  fs/super.c         |    4 ++--
4  include/linux/fs.h |    2 +-
5  4 files changed, 18 insertions(+), 11 deletions(-)
6
7 --- kernel-2.4.20-6chaos_18_7/fs/inode.c~invalidate_show_2.4.20_chaos   2003-05-15 21:14:25.000000000 -0600
8 +++ kernel-2.4.20-6chaos_18_7-braam/fs/inode.c  2003-07-12 15:33:08.000000000 -0600
9 @@ -604,7 +604,8 @@ static void dispose_list(struct list_hea
10  /*
11   * Invalidate all inodes for a device.
12   */
13 -static int invalidate_list(struct list_head *head, struct super_block * sb, struct list_head * dispose)
14 +static int invalidate_list(struct list_head *head, struct super_block * sb,
15 +                          struct list_head * dispose, int show)
16  {
17         struct list_head *next;
18         int busy = 0, count = 0;
19 @@ -629,6 +630,11 @@ static int invalidate_list(struct list_h
20                         count++;
21                         continue;
22                 }
23 +               if (show)
24 +                       printk(KERN_ERR
25 +                              "inode busy: dev %s:%lu (%p) mode %o count %u\n",
26 +                              kdevname(sb->s_dev), inode->i_ino, inode,
27 +                              inode->i_mode, atomic_read(&inode->i_count));
28                 busy = 1;
29         }
30         /* only unused inodes may be cached with i_count zero */
31 @@ -647,22 +653,23 @@ static int invalidate_list(struct list_h
32  /**
33   *     invalidate_inodes       - discard the inodes on a device
34   *     @sb: superblock
35 + *      @show: whether we should display any busy inodes found
36   *
37   *     Discard all of the inodes for a given superblock. If the discard
38   *     fails because there are busy inodes then a non zero value is returned.
39   *     If the discard is successful all the inodes have been discarded.
40   */
41   
42 -int invalidate_inodes(struct super_block * sb)
43 +int invalidate_inodes(struct super_block * sb, int show)
44  {
45         int busy;
46         LIST_HEAD(throw_away);
47  
48         spin_lock(&inode_lock);
49 -       busy = invalidate_list(&inode_in_use, sb, &throw_away);
50 -       busy |= invalidate_list(&inode_unused, sb, &throw_away);
51 -       busy |= invalidate_list(&sb->s_dirty, sb, &throw_away);
52 -       busy |= invalidate_list(&sb->s_locked_inodes, sb, &throw_away);
53 +       busy = invalidate_list(&inode_in_use, sb, &throw_away, show);
54 +       busy |= invalidate_list(&inode_unused, sb, &throw_away, show);
55 +       busy |= invalidate_list(&sb->s_dirty, sb, &throw_away, show);
56 +       busy |= invalidate_list(&sb->s_locked_inodes, sb, &throw_away, show);
57         spin_unlock(&inode_lock);
58  
59         dispose_list(&throw_away);
60 @@ -688,7 +695,7 @@ int invalidate_device(kdev_t dev, int do
61                  * hold).
62                  */
63                 shrink_dcache_sb(sb);
64 -               res = invalidate_inodes(sb);
65 +               res = invalidate_inodes(sb, 0);
66                 drop_super(sb);
67         }
68         invalidate_buffers(dev);
69 --- kernel-2.4.20-6chaos_18_7/fs/super.c~invalidate_show_2.4.20_chaos   2003-05-15 21:14:25.000000000 -0600
70 +++ kernel-2.4.20-6chaos_18_7-braam/fs/super.c  2003-07-12 15:31:35.000000000 -0600
71 @@ -943,7 +943,7 @@ void kill_super(struct super_block *sb)
72         lock_super(sb);
73         lock_kernel();
74         sb->s_flags &= ~MS_ACTIVE;
75 -       invalidate_inodes(sb);  /* bad name - it should be evict_inodes() */
76 +       invalidate_inodes(sb, 0);  /* bad name - it should be evict_inodes() */
77         if (sop) {
78                 if (sop->write_super && sb->s_dirt)
79                         sop->write_super(sb);
80 @@ -952,7 +952,7 @@ void kill_super(struct super_block *sb)
81         }
82  
83         /* Forget any remaining inodes */
84 -       if (invalidate_inodes(sb)) {
85 +       if (invalidate_inodes(sb, 1)) {
86                 printk(KERN_ERR "VFS: Busy inodes after unmount. "
87                         "Self-destruct in 5 seconds.  Have a nice day...\n");
88         }
89 --- kernel-2.4.20-6chaos_18_7/include/linux/fs.h~invalidate_show_2.4.20_chaos   2003-07-12 15:14:02.000000000 -0600
90 +++ kernel-2.4.20-6chaos_18_7-braam/include/linux/fs.h  2003-07-12 15:31:35.000000000 -0600
91 @@ -1284,7 +1284,7 @@ static inline void mark_buffer_dirty_ino
92  extern void set_buffer_flushtime(struct buffer_head *);
93  extern void balance_dirty(void);
94  extern int check_disk_change(kdev_t);
95 -extern int invalidate_inodes(struct super_block *);
96 +extern int invalidate_inodes(struct super_block *, int);
97  extern int invalidate_device(kdev_t, int);
98  extern void invalidate_inode_pages(struct inode *);
99  extern void invalidate_inode_pages2(struct address_space *);
100 --- kernel-2.4.20-6chaos_18_7/fs/smbfs/inode.c~invalidate_show_2.4.20_chaos     2003-02-14 15:59:13.000000000 -0700
101 +++ kernel-2.4.20-6chaos_18_7-braam/fs/smbfs/inode.c    2003-07-12 15:31:35.000000000 -0600
102 @@ -167,7 +167,7 @@ smb_invalidate_inodes(struct smb_sb_info
103  {
104         VERBOSE("\n");
105         shrink_dcache_sb(SB_of(server));
106 -       invalidate_inodes(SB_of(server));
107 +       invalidate_inodes(SB_of(server), 0);
108  }
109  
110  /*
111
112 _