Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / kernel_patches / patches / invalidate_show-2.4.20-hp.patch
1
2
3
4  fs/inode.c         |   21 ++++++++++++++-------
5  fs/smbfs/inode.c   |    2 +-
6  fs/super.c         |    4 ++--
7  include/linux/fs.h |    2 +-
8  4 files changed, 18 insertions(+), 11 deletions(-)
9
10 Index: linux/fs/inode.c
11 ===================================================================
12 --- linux.orig/fs/inode.c       Mon Feb  2 21:24:21 2004
13 +++ linux/fs/inode.c    Mon Feb  2 21:27:53 2004
14 @@ -632,7 +632,8 @@
15  /*
16   * Invalidate all inodes for a device.
17   */
18 -static int invalidate_list(struct list_head *head, struct super_block * sb, struct list_head * dispose)
19 +static int invalidate_list(struct list_head *head, struct super_block * sb,
20 +                          struct list_head * dispose, int show)
21  {
22         struct list_head *next;
23         int busy = 0, count = 0;
24 @@ -657,6 +658,11 @@
25                         count++;
26                         continue;
27                 }
28 +               if (show)
29 +                       printk(KERN_ERR
30 +                              "inode busy: dev %s:%lu (%p) mode %o count %u\n",
31 +                              kdevname(sb->s_dev), inode->i_ino, inode,
32 +                              inode->i_mode, atomic_read(&inode->i_count));
33                 busy = 1;
34         }
35         /* only unused inodes may be cached with i_count zero */
36 @@ -675,23 +681,24 @@
37  /**
38   *     invalidate_inodes       - discard the inodes on a device
39   *     @sb: superblock
40 + *     @show: whether we should display any busy inodes found
41   *
42   *     Discard all of the inodes for a given superblock. If the discard
43   *     fails because there are busy inodes then a non zero value is returned.
44   *     If the discard is successful all the inodes have been discarded.
45   */
46   
47 -int invalidate_inodes(struct super_block * sb)
48 +int invalidate_inodes(struct super_block * sb, int show)
49  {
50         int busy;
51         LIST_HEAD(throw_away);
52  
53         spin_lock(&inode_lock);
54 -       busy = invalidate_list(&inode_in_use, sb, &throw_away);
55 -       busy |= invalidate_list(&inode_unused, sb, &throw_away);
56 -       busy |= invalidate_list(&inode_unused_pagecache, sb, &throw_away);
57 -       busy |= invalidate_list(&sb->s_dirty, sb, &throw_away);
58 -       busy |= invalidate_list(&sb->s_locked_inodes, sb, &throw_away);
59 +       busy = invalidate_list(&inode_in_use, sb, &throw_away, show);
60 +       busy |= invalidate_list(&inode_unused, sb, &throw_away, show);
61 +       busy |= invalidate_list(&inode_unused_pagecache, sb, &throw_away, show);
62 +       busy |= invalidate_list(&sb->s_dirty, sb, &throw_away, show);
63 +       busy |= invalidate_list(&sb->s_locked_inodes, sb, &throw_away, show);
64         spin_unlock(&inode_lock);
65  
66         dispose_list(&throw_away);
67 @@ -717,7 +724,7 @@
68                  * hold).
69                  */
70                 shrink_dcache_sb(sb);
71 -               res = invalidate_inodes(sb);
72 +               res = invalidate_inodes(sb, 0);
73                 drop_super(sb);
74         }
75         invalidate_buffers(dev);
76 Index: linux/fs/super.c
77 ===================================================================
78 --- linux.orig/fs/super.c       Mon Feb  2 21:24:21 2004
79 +++ linux/fs/super.c    Mon Feb  2 21:26:08 2004
80 @@ -844,7 +844,7 @@
81         lock_super(sb);
82         lock_kernel();
83         sb->s_flags &= ~MS_ACTIVE;
84 -       invalidate_inodes(sb);  /* bad name - it should be evict_inodes() */
85 +       invalidate_inodes(sb, 0);  /* bad name - it should be evict_inodes() */
86         if (sop) {
87                 if (sop->write_super && sb->s_dirt)
88                         sop->write_super(sb);
89 @@ -853,7 +853,7 @@
90         }
91  
92         /* Forget any remaining inodes */
93 -       if (invalidate_inodes(sb)) {
94 +       if (invalidate_inodes(sb, 1)) {
95                 printk(KERN_ERR "VFS: Busy inodes after unmount. "
96                         "Self-destruct in 5 seconds.  Have a nice day...\n");
97         }
98 Index: linux/include/linux/fs.h
99 ===================================================================
100 --- linux.orig/include/linux/fs.h       Mon Feb  2 21:24:23 2004
101 +++ linux/include/linux/fs.h    Mon Feb  2 21:26:08 2004
102 @@ -1257,7 +1257,7 @@
103  extern void set_buffer_flushtime(struct buffer_head *);
104  extern void balance_dirty(void);
105  extern int check_disk_change(kdev_t);
106 -extern int invalidate_inodes(struct super_block *);
107 +extern int invalidate_inodes(struct super_block *, int);
108  extern int invalidate_device(kdev_t, int);
109  extern void invalidate_inode_pages(struct inode *);
110  extern void invalidate_inode_pages2(struct address_space *);
111 Index: linux/fs/smbfs/inode.c
112 ===================================================================
113 --- linux.orig/fs/smbfs/inode.c Thu Nov 28 18:53:15 2002
114 +++ linux/fs/smbfs/inode.c      Mon Feb  2 21:26:08 2004
115 @@ -167,7 +167,7 @@
116  {
117         VERBOSE("\n");
118         shrink_dcache_sb(SB_of(server));
119 -       invalidate_inodes(SB_of(server));
120 +       invalidate_inodes(SB_of(server), 0);
121  }
122  
123  /*