]> git.pld-linux.org Git - packages/kernel.git/blob - 2.4.15-inode.c.fix
9cdd694a797623b3d0f76ee69304dd85 linux-loop-hvr-2.4.16.0.patch
[packages/kernel.git] / 2.4.15-inode.c.fix
1 diff -urN S15/fs/inode.c S15-fix/fs/inode.c
2 --- S15/fs/inode.c      Fri Nov 23 06:45:43 2001
3 +++ S15-fix/fs/inode.c  Fri Nov 23 16:33:33 2001
4 @@ -1065,24 +1065,27 @@
5                         if (inode->i_state != I_CLEAR)
6                                 BUG();
7                 } else {
8 -                       if (!list_empty(&inode->i_hash) && sb && sb->s_root) {
9 +                       if (!list_empty(&inode->i_hash) {
10                                 if (!(inode->i_state & (I_DIRTY|I_LOCK))) {
11                                         list_del(&inode->i_list);
12                                         list_add(&inode->i_list, &inode_unused);
13                                 }
14                                 inodes_stat.nr_unused++;
15                                 spin_unlock(&inode_lock);
16 -                               return;
17 -                       } else {
18 -                               list_del_init(&inode->i_list);
19 +                               if (!sb || sb->s_flags & MS_ACTIVE))
20 +                                       return;
21 +                               write_inode_now(inode);
22 +                               spin_lock(&inode_lock);
23 +                               inodes_stat.nr_unused--;
24                                 list_del_init(&inode->i_hash);
25 -                               inode->i_state|=I_FREEING;
26 -                               inodes_stat.nr_inodes--;
27 -                               spin_unlock(&inode_lock);
28 -                               if (inode->i_data.nrpages)
29 -                                       truncate_inode_pages(&inode->i_data, 0);
30 -                               clear_inode(inode);
31                         }
32 +                       list_del_init(&inode->i_list);
33 +                       inode->i_state|=I_FREEING;
34 +                       inodes_stat.nr_inodes--;
35 +                       spin_unlock(&inode_lock);
36 +                       if (inode->i_data.nrpages)
37 +                               truncate_inode_pages(&inode->i_data, 0);
38 +                       clear_inode(inode);
39                 }
40                 destroy_inode(inode);
41         }
42 diff -urN S15/fs/super.c S15-fix/fs/super.c
43 --- S15/fs/super.c      Fri Nov 23 06:45:43 2001
44 +++ S15-fix/fs/super.c  Fri Nov 23 16:26:18 2001
45 @@ -462,6 +462,7 @@
46         lock_super(s);
47         if (!type->read_super(s, data, flags & MS_VERBOSE ? 1 : 0))
48                 goto out_fail;
49 +       s->s_flags |= MS_ACTIVE;
50         unlock_super(s);
51         /* tell bdcache that we are going to keep this one */
52         if (bdev)
53 @@ -614,6 +615,7 @@
54         lock_super(s);
55         if (!fs_type->read_super(s, data, flags & MS_VERBOSE ? 1 : 0))
56                 goto out_fail;
57 +       s->s_flags |= MS_ACTIVE;
58         unlock_super(s);
59         get_filesystem(fs_type);
60         path_release(&nd);
61 @@ -695,6 +697,7 @@
62                 lock_super(s);
63                 if (!fs_type->read_super(s, data, flags & MS_VERBOSE ? 1 : 0))
64                         goto out_fail;
65 +               s->s_flags |= MS_ACTIVE;
66                 unlock_super(s);
67                 get_filesystem(fs_type);
68                 return s;
69 @@ -739,6 +742,7 @@
70         dput(root);
71         fsync_super(sb);
72         lock_super(sb);
73 +       sb->s_flags &= ~MS_ACTIVE;
74         invalidate_inodes(sb);  /* bad name - it should be evict_inodes() */
75         if (sop) {
76                 if (sop->write_super && sb->s_dirt)
77 diff -urN S15/include/linux/fs.h S15-fix/include/linux/fs.h
78 --- S15/include/linux/fs.h      Fri Nov 23 06:45:44 2001
79 +++ S15-fix/include/linux/fs.h  Fri Nov 23 16:24:44 2001
80 @@ -110,6 +110,7 @@
81  #define MS_BIND                4096
82  #define MS_REC         16384
83  #define MS_VERBOSE     32768
84 +#define MS_ACTIVE      (1<<30)
85  #define MS_NOUSER      (1<<31)
86  
87  /*
88
This page took 0.032478 seconds and 3 git commands to generate.