diff options
author | Paul Mackerras <paulus@samba.org> | 2007-12-09 23:41:22 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-12-09 23:41:22 -0500 |
commit | b242a60206881559bb3102110048762422e6b74e (patch) | |
tree | 86459efa47b9c3f69d865b4495beede9c4184003 /fs | |
parent | e1fd18656c2963e383d67b7006c0e06c9c1d9c79 (diff) | |
parent | 94545baded0bfbabdc30a3a4cb48b3db479dd6ef (diff) |
Merge branch 'linux-2.6'
Diffstat (limited to 'fs')
-rw-r--r-- | fs/aio.c | 7 | ||||
-rw-r--r-- | fs/bfs/inode.c | 3 | ||||
-rw-r--r-- | fs/cifs/cifsacl.c | 33 | ||||
-rw-r--r-- | fs/jbd/checkpoint.c | 12 | ||||
-rw-r--r-- | fs/jbd/commit.c | 8 | ||||
-rw-r--r-- | fs/jffs2/background.c | 2 | ||||
-rw-r--r-- | fs/ocfs2/cluster/tcp.c | 20 | ||||
-rw-r--r-- | fs/proc/generic.c | 21 | ||||
-rw-r--r-- | fs/proc/inode.c | 9 | ||||
-rw-r--r-- | fs/proc/proc_net.c | 86 | ||||
-rw-r--r-- | fs/proc/root.c | 1 | ||||
-rw-r--r-- | fs/reiserfs/procfs.c | 6 | ||||
-rw-r--r-- | fs/ufs/dir.c | 2 | ||||
-rw-r--r-- | fs/ufs/super.c | 4 |
14 files changed, 66 insertions, 148 deletions
@@ -1161,7 +1161,12 @@ retry: | |||
1161 | ret = 0; | 1161 | ret = 0; |
1162 | if (to.timed_out) /* Only check after read evt */ | 1162 | if (to.timed_out) /* Only check after read evt */ |
1163 | break; | 1163 | break; |
1164 | io_schedule(); | 1164 | /* Try to only show up in io wait if there are ops |
1165 | * in flight */ | ||
1166 | if (ctx->reqs_active) | ||
1167 | io_schedule(); | ||
1168 | else | ||
1169 | schedule(); | ||
1165 | if (signal_pending(tsk)) { | 1170 | if (signal_pending(tsk)) { |
1166 | ret = -EINTR; | 1171 | ret = -EINTR; |
1167 | break; | 1172 | break; |
diff --git a/fs/bfs/inode.c b/fs/bfs/inode.c index 294c41baef6e..a64a71d444f5 100644 --- a/fs/bfs/inode.c +++ b/fs/bfs/inode.c | |||
@@ -178,7 +178,8 @@ static void bfs_delete_inode(struct inode *inode) | |||
178 | brelse(bh); | 178 | brelse(bh); |
179 | 179 | ||
180 | if (bi->i_dsk_ino) { | 180 | if (bi->i_dsk_ino) { |
181 | info->si_freeb += BFS_FILEBLOCKS(bi); | 181 | if (bi->i_sblock) |
182 | info->si_freeb += bi->i_eblock + 1 - bi->i_sblock; | ||
182 | info->si_freei++; | 183 | info->si_freei++; |
183 | clear_bit(ino, info->si_imap); | 184 | clear_bit(ino, info->si_imap); |
184 | dump_imap("delete_inode", s); | 185 | dump_imap("delete_inode", s); |
diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c index f02fdef463a7..c312adcba4fc 100644 --- a/fs/cifs/cifsacl.c +++ b/fs/cifs/cifsacl.c | |||
@@ -134,9 +134,10 @@ int compare_sids(const struct cifs_sid *ctsid, const struct cifs_sid *cwsid) | |||
134 | pmode is the existing mode (we only want to overwrite part of this | 134 | pmode is the existing mode (we only want to overwrite part of this |
135 | bits to set can be: S_IRWXU, S_IRWXG or S_IRWXO ie 00700 or 00070 or 00007 | 135 | bits to set can be: S_IRWXU, S_IRWXG or S_IRWXO ie 00700 or 00070 or 00007 |
136 | */ | 136 | */ |
137 | static void access_flags_to_mode(__u32 ace_flags, int type, umode_t *pmode, | 137 | static void access_flags_to_mode(__le32 ace_flags, int type, umode_t *pmode, |
138 | umode_t *pbits_to_set) | 138 | umode_t *pbits_to_set) |
139 | { | 139 | { |
140 | __u32 flags = le32_to_cpu(ace_flags); | ||
140 | /* the order of ACEs is important. The canonical order is to begin with | 141 | /* the order of ACEs is important. The canonical order is to begin with |
141 | DENY entries followed by ALLOW, otherwise an allow entry could be | 142 | DENY entries followed by ALLOW, otherwise an allow entry could be |
142 | encountered first, making the subsequent deny entry like "dead code" | 143 | encountered first, making the subsequent deny entry like "dead code" |
@@ -146,17 +147,17 @@ static void access_flags_to_mode(__u32 ace_flags, int type, umode_t *pmode, | |||
146 | /* For deny ACEs we change the mask so that subsequent allow access | 147 | /* For deny ACEs we change the mask so that subsequent allow access |
147 | control entries do not turn on the bits we are denying */ | 148 | control entries do not turn on the bits we are denying */ |
148 | if (type == ACCESS_DENIED) { | 149 | if (type == ACCESS_DENIED) { |
149 | if (ace_flags & GENERIC_ALL) { | 150 | if (flags & GENERIC_ALL) { |
150 | *pbits_to_set &= ~S_IRWXUGO; | 151 | *pbits_to_set &= ~S_IRWXUGO; |
151 | } | 152 | } |
152 | if ((ace_flags & GENERIC_WRITE) || | 153 | if ((flags & GENERIC_WRITE) || |
153 | ((ace_flags & FILE_WRITE_RIGHTS) == FILE_WRITE_RIGHTS)) | 154 | ((flags & FILE_WRITE_RIGHTS) == FILE_WRITE_RIGHTS)) |
154 | *pbits_to_set &= ~S_IWUGO; | 155 | *pbits_to_set &= ~S_IWUGO; |
155 | if ((ace_flags & GENERIC_READ) || | 156 | if ((flags & GENERIC_READ) || |
156 | ((ace_flags & FILE_READ_RIGHTS) == FILE_READ_RIGHTS)) | 157 | ((flags & FILE_READ_RIGHTS) == FILE_READ_RIGHTS)) |
157 | *pbits_to_set &= ~S_IRUGO; | 158 | *pbits_to_set &= ~S_IRUGO; |
158 | if ((ace_flags & GENERIC_EXECUTE) || | 159 | if ((flags & GENERIC_EXECUTE) || |
159 | ((ace_flags & FILE_EXEC_RIGHTS) == FILE_EXEC_RIGHTS)) | 160 | ((flags & FILE_EXEC_RIGHTS) == FILE_EXEC_RIGHTS)) |
160 | *pbits_to_set &= ~S_IXUGO; | 161 | *pbits_to_set &= ~S_IXUGO; |
161 | return; | 162 | return; |
162 | } else if (type != ACCESS_ALLOWED) { | 163 | } else if (type != ACCESS_ALLOWED) { |
@@ -165,25 +166,25 @@ static void access_flags_to_mode(__u32 ace_flags, int type, umode_t *pmode, | |||
165 | } | 166 | } |
166 | /* else ACCESS_ALLOWED type */ | 167 | /* else ACCESS_ALLOWED type */ |
167 | 168 | ||
168 | if (ace_flags & GENERIC_ALL) { | 169 | if (flags & GENERIC_ALL) { |
169 | *pmode |= (S_IRWXUGO & (*pbits_to_set)); | 170 | *pmode |= (S_IRWXUGO & (*pbits_to_set)); |
170 | #ifdef CONFIG_CIFS_DEBUG2 | 171 | #ifdef CONFIG_CIFS_DEBUG2 |
171 | cFYI(1, ("all perms")); | 172 | cFYI(1, ("all perms")); |
172 | #endif | 173 | #endif |
173 | return; | 174 | return; |
174 | } | 175 | } |
175 | if ((ace_flags & GENERIC_WRITE) || | 176 | if ((flags & GENERIC_WRITE) || |
176 | ((ace_flags & FILE_WRITE_RIGHTS) == FILE_WRITE_RIGHTS)) | 177 | ((flags & FILE_WRITE_RIGHTS) == FILE_WRITE_RIGHTS)) |
177 | *pmode |= (S_IWUGO & (*pbits_to_set)); | 178 | *pmode |= (S_IWUGO & (*pbits_to_set)); |
178 | if ((ace_flags & GENERIC_READ) || | 179 | if ((flags & GENERIC_READ) || |
179 | ((ace_flags & FILE_READ_RIGHTS) == FILE_READ_RIGHTS)) | 180 | ((flags & FILE_READ_RIGHTS) == FILE_READ_RIGHTS)) |
180 | *pmode |= (S_IRUGO & (*pbits_to_set)); | 181 | *pmode |= (S_IRUGO & (*pbits_to_set)); |
181 | if ((ace_flags & GENERIC_EXECUTE) || | 182 | if ((flags & GENERIC_EXECUTE) || |
182 | ((ace_flags & FILE_EXEC_RIGHTS) == FILE_EXEC_RIGHTS)) | 183 | ((flags & FILE_EXEC_RIGHTS) == FILE_EXEC_RIGHTS)) |
183 | *pmode |= (S_IXUGO & (*pbits_to_set)); | 184 | *pmode |= (S_IXUGO & (*pbits_to_set)); |
184 | 185 | ||
185 | #ifdef CONFIG_CIFS_DEBUG2 | 186 | #ifdef CONFIG_CIFS_DEBUG2 |
186 | cFYI(1, ("access flags 0x%x mode now 0x%x", ace_flags, *pmode)); | 187 | cFYI(1, ("access flags 0x%x mode now 0x%x", flags, *pmode)); |
187 | #endif | 188 | #endif |
188 | return; | 189 | return; |
189 | } | 190 | } |
diff --git a/fs/jbd/checkpoint.c b/fs/jbd/checkpoint.c index 47552d4a6324..0f69c416eebc 100644 --- a/fs/jbd/checkpoint.c +++ b/fs/jbd/checkpoint.c | |||
@@ -602,15 +602,15 @@ int __journal_remove_checkpoint(struct journal_head *jh) | |||
602 | 602 | ||
603 | /* | 603 | /* |
604 | * There is one special case to worry about: if we have just pulled the | 604 | * There is one special case to worry about: if we have just pulled the |
605 | * buffer off a committing transaction's forget list, then even if the | 605 | * buffer off a running or committing transaction's checkpoing list, |
606 | * checkpoint list is empty, the transaction obviously cannot be | 606 | * then even if the checkpoint list is empty, the transaction obviously |
607 | * dropped! | 607 | * cannot be dropped! |
608 | * | 608 | * |
609 | * The locking here around j_committing_transaction is a bit sleazy. | 609 | * The locking here around t_state is a bit sleazy. |
610 | * See the comment at the end of journal_commit_transaction(). | 610 | * See the comment at the end of journal_commit_transaction(). |
611 | */ | 611 | */ |
612 | if (transaction == journal->j_committing_transaction) { | 612 | if (transaction->t_state != T_FINISHED) { |
613 | JBUFFER_TRACE(jh, "belongs to committing transaction"); | 613 | JBUFFER_TRACE(jh, "belongs to running/committing transaction"); |
614 | goto out; | 614 | goto out; |
615 | } | 615 | } |
616 | 616 | ||
diff --git a/fs/jbd/commit.c b/fs/jbd/commit.c index 8f1f2aa5fb39..610264b99a8e 100644 --- a/fs/jbd/commit.c +++ b/fs/jbd/commit.c | |||
@@ -858,10 +858,10 @@ restart_loop: | |||
858 | } | 858 | } |
859 | spin_unlock(&journal->j_list_lock); | 859 | spin_unlock(&journal->j_list_lock); |
860 | /* | 860 | /* |
861 | * This is a bit sleazy. We borrow j_list_lock to protect | 861 | * This is a bit sleazy. We use j_list_lock to protect transition |
862 | * journal->j_committing_transaction in __journal_remove_checkpoint. | 862 | * of a transaction into T_FINISHED state and calling |
863 | * Really, __journal_remove_checkpoint should be using j_state_lock but | 863 | * __journal_drop_transaction(). Otherwise we could race with |
864 | * it's a bit hassle to hold that across __journal_remove_checkpoint | 864 | * other checkpointing code processing the transaction... |
865 | */ | 865 | */ |
866 | spin_lock(&journal->j_state_lock); | 866 | spin_lock(&journal->j_state_lock); |
867 | spin_lock(&journal->j_list_lock); | 867 | spin_lock(&journal->j_list_lock); |
diff --git a/fs/jffs2/background.c b/fs/jffs2/background.c index d568ae846741..8adebd3e43c6 100644 --- a/fs/jffs2/background.c +++ b/fs/jffs2/background.c | |||
@@ -105,7 +105,7 @@ static int jffs2_garbage_collect_thread(void *_c) | |||
105 | 105 | ||
106 | /* Put_super will send a SIGKILL and then wait on the sem. | 106 | /* Put_super will send a SIGKILL and then wait on the sem. |
107 | */ | 107 | */ |
108 | while (signal_pending(current)) { | 108 | while (signal_pending(current) || freezing(current)) { |
109 | siginfo_t info; | 109 | siginfo_t info; |
110 | unsigned long signr; | 110 | unsigned long signr; |
111 | 111 | ||
diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c index d84bd155997b..ee50c9610e7f 100644 --- a/fs/ocfs2/cluster/tcp.c +++ b/fs/ocfs2/cluster/tcp.c | |||
@@ -72,14 +72,6 @@ | |||
72 | 72 | ||
73 | #include "tcp_internal.h" | 73 | #include "tcp_internal.h" |
74 | 74 | ||
75 | /* | ||
76 | * The linux network stack isn't sparse endian clean.. It has macros like | ||
77 | * ntohs() which perform the endian checks and structs like sockaddr_in | ||
78 | * which aren't annotated. So __force is found here to get the build | ||
79 | * clean. When they emerge from the dark ages and annotate the code | ||
80 | * we can remove these. | ||
81 | */ | ||
82 | |||
83 | #define SC_NODEF_FMT "node %s (num %u) at %u.%u.%u.%u:%u" | 75 | #define SC_NODEF_FMT "node %s (num %u) at %u.%u.%u.%u:%u" |
84 | #define SC_NODEF_ARGS(sc) sc->sc_node->nd_name, sc->sc_node->nd_num, \ | 76 | #define SC_NODEF_ARGS(sc) sc->sc_node->nd_name, sc->sc_node->nd_num, \ |
85 | NIPQUAD(sc->sc_node->nd_ipv4_address), \ | 77 | NIPQUAD(sc->sc_node->nd_ipv4_address), \ |
@@ -1500,7 +1492,7 @@ static void o2net_start_connect(struct work_struct *work) | |||
1500 | 1492 | ||
1501 | myaddr.sin_family = AF_INET; | 1493 | myaddr.sin_family = AF_INET; |
1502 | myaddr.sin_addr.s_addr = mynode->nd_ipv4_address; | 1494 | myaddr.sin_addr.s_addr = mynode->nd_ipv4_address; |
1503 | myaddr.sin_port = (__force u16)htons(0); /* any port */ | 1495 | myaddr.sin_port = htons(0); /* any port */ |
1504 | 1496 | ||
1505 | ret = sock->ops->bind(sock, (struct sockaddr *)&myaddr, | 1497 | ret = sock->ops->bind(sock, (struct sockaddr *)&myaddr, |
1506 | sizeof(myaddr)); | 1498 | sizeof(myaddr)); |
@@ -1701,11 +1693,11 @@ static int o2net_accept_one(struct socket *sock) | |||
1701 | if (ret < 0) | 1693 | if (ret < 0) |
1702 | goto out; | 1694 | goto out; |
1703 | 1695 | ||
1704 | node = o2nm_get_node_by_ip((__force __be32)sin.sin_addr.s_addr); | 1696 | node = o2nm_get_node_by_ip(sin.sin_addr.s_addr); |
1705 | if (node == NULL) { | 1697 | if (node == NULL) { |
1706 | mlog(ML_NOTICE, "attempt to connect from unknown node at " | 1698 | mlog(ML_NOTICE, "attempt to connect from unknown node at " |
1707 | "%u.%u.%u.%u:%d\n", NIPQUAD(sin.sin_addr.s_addr), | 1699 | "%u.%u.%u.%u:%d\n", NIPQUAD(sin.sin_addr.s_addr), |
1708 | ntohs((__force __be16)sin.sin_port)); | 1700 | ntohs(sin.sin_port)); |
1709 | ret = -EINVAL; | 1701 | ret = -EINVAL; |
1710 | goto out; | 1702 | goto out; |
1711 | } | 1703 | } |
@@ -1714,7 +1706,7 @@ static int o2net_accept_one(struct socket *sock) | |||
1714 | mlog(ML_NOTICE, "unexpected connect attempted from a lower " | 1706 | mlog(ML_NOTICE, "unexpected connect attempted from a lower " |
1715 | "numbered node '%s' at " "%u.%u.%u.%u:%d with num %u\n", | 1707 | "numbered node '%s' at " "%u.%u.%u.%u:%d with num %u\n", |
1716 | node->nd_name, NIPQUAD(sin.sin_addr.s_addr), | 1708 | node->nd_name, NIPQUAD(sin.sin_addr.s_addr), |
1717 | ntohs((__force __be16)sin.sin_port), node->nd_num); | 1709 | ntohs(sin.sin_port), node->nd_num); |
1718 | ret = -EINVAL; | 1710 | ret = -EINVAL; |
1719 | goto out; | 1711 | goto out; |
1720 | } | 1712 | } |
@@ -1725,7 +1717,7 @@ static int o2net_accept_one(struct socket *sock) | |||
1725 | mlog(ML_CONN, "attempt to connect from node '%s' at " | 1717 | mlog(ML_CONN, "attempt to connect from node '%s' at " |
1726 | "%u.%u.%u.%u:%d but it isn't heartbeating\n", | 1718 | "%u.%u.%u.%u:%d but it isn't heartbeating\n", |
1727 | node->nd_name, NIPQUAD(sin.sin_addr.s_addr), | 1719 | node->nd_name, NIPQUAD(sin.sin_addr.s_addr), |
1728 | ntohs((__force __be16)sin.sin_port)); | 1720 | ntohs(sin.sin_port)); |
1729 | ret = -EINVAL; | 1721 | ret = -EINVAL; |
1730 | goto out; | 1722 | goto out; |
1731 | } | 1723 | } |
@@ -1742,7 +1734,7 @@ static int o2net_accept_one(struct socket *sock) | |||
1742 | mlog(ML_NOTICE, "attempt to connect from node '%s' at " | 1734 | mlog(ML_NOTICE, "attempt to connect from node '%s' at " |
1743 | "%u.%u.%u.%u:%d but it already has an open connection\n", | 1735 | "%u.%u.%u.%u:%d but it already has an open connection\n", |
1744 | node->nd_name, NIPQUAD(sin.sin_addr.s_addr), | 1736 | node->nd_name, NIPQUAD(sin.sin_addr.s_addr), |
1745 | ntohs((__force __be16)sin.sin_port)); | 1737 | ntohs(sin.sin_port)); |
1746 | goto out; | 1738 | goto out; |
1747 | } | 1739 | } |
1748 | 1740 | ||
diff --git a/fs/proc/generic.c b/fs/proc/generic.c index 39f3d6519035..8d49838e5554 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c | |||
@@ -374,9 +374,16 @@ static int proc_delete_dentry(struct dentry * dentry) | |||
374 | return 1; | 374 | return 1; |
375 | } | 375 | } |
376 | 376 | ||
377 | static int proc_revalidate_dentry(struct dentry *dentry, struct nameidata *nd) | ||
378 | { | ||
379 | d_drop(dentry); | ||
380 | return 0; | ||
381 | } | ||
382 | |||
377 | static struct dentry_operations proc_dentry_operations = | 383 | static struct dentry_operations proc_dentry_operations = |
378 | { | 384 | { |
379 | .d_delete = proc_delete_dentry, | 385 | .d_delete = proc_delete_dentry, |
386 | .d_revalidate = proc_revalidate_dentry, | ||
380 | }; | 387 | }; |
381 | 388 | ||
382 | /* | 389 | /* |
@@ -397,8 +404,11 @@ struct dentry *proc_lookup(struct inode * dir, struct dentry *dentry, struct nam | |||
397 | if (de->namelen != dentry->d_name.len) | 404 | if (de->namelen != dentry->d_name.len) |
398 | continue; | 405 | continue; |
399 | if (!memcmp(dentry->d_name.name, de->name, de->namelen)) { | 406 | if (!memcmp(dentry->d_name.name, de->name, de->namelen)) { |
400 | unsigned int ino = de->low_ino; | 407 | unsigned int ino; |
401 | 408 | ||
409 | if (de->shadow_proc) | ||
410 | de = de->shadow_proc(current, de); | ||
411 | ino = de->low_ino; | ||
402 | de_get(de); | 412 | de_get(de); |
403 | spin_unlock(&proc_subdir_lock); | 413 | spin_unlock(&proc_subdir_lock); |
404 | error = -EINVAL; | 414 | error = -EINVAL; |
@@ -585,6 +595,7 @@ static struct proc_dir_entry *proc_create(struct proc_dir_entry **parent, | |||
585 | ent->namelen = len; | 595 | ent->namelen = len; |
586 | ent->mode = mode; | 596 | ent->mode = mode; |
587 | ent->nlink = nlink; | 597 | ent->nlink = nlink; |
598 | atomic_set(&ent->count, 1); | ||
588 | ent->pde_users = 0; | 599 | ent->pde_users = 0; |
589 | spin_lock_init(&ent->pde_unload_lock); | 600 | spin_lock_init(&ent->pde_unload_lock); |
590 | ent->pde_unload_completion = NULL; | 601 | ent->pde_unload_completion = NULL; |
@@ -682,7 +693,6 @@ void free_proc_entry(struct proc_dir_entry *de) | |||
682 | 693 | ||
683 | /* | 694 | /* |
684 | * Remove a /proc entry and free it if it's not currently in use. | 695 | * Remove a /proc entry and free it if it's not currently in use. |
685 | * If it is in use, we set the 'deleted' flag. | ||
686 | */ | 696 | */ |
687 | void remove_proc_entry(const char *name, struct proc_dir_entry *parent) | 697 | void remove_proc_entry(const char *name, struct proc_dir_entry *parent) |
688 | { | 698 | { |
@@ -731,13 +741,8 @@ continue_removing: | |||
731 | parent->nlink--; | 741 | parent->nlink--; |
732 | de->nlink = 0; | 742 | de->nlink = 0; |
733 | WARN_ON(de->subdir); | 743 | WARN_ON(de->subdir); |
734 | if (!atomic_read(&de->count)) | 744 | if (atomic_dec_and_test(&de->count)) |
735 | free_proc_entry(de); | 745 | free_proc_entry(de); |
736 | else { | ||
737 | de->deleted = 1; | ||
738 | printk("remove_proc_entry: %s/%s busy, count=%d\n", | ||
739 | parent->name, de->name, atomic_read(&de->count)); | ||
740 | } | ||
741 | break; | 746 | break; |
742 | } | 747 | } |
743 | spin_unlock(&proc_subdir_lock); | 748 | spin_unlock(&proc_subdir_lock); |
diff --git a/fs/proc/inode.c b/fs/proc/inode.c index abe6a3f04368..1a551d92e1d8 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c | |||
@@ -43,13 +43,8 @@ void de_put(struct proc_dir_entry *de) | |||
43 | return; | 43 | return; |
44 | } | 44 | } |
45 | 45 | ||
46 | if (atomic_dec_and_test(&de->count)) { | 46 | if (atomic_dec_and_test(&de->count)) |
47 | if (de->deleted) { | 47 | free_proc_entry(de); |
48 | printk("de_put: deferred delete of %s\n", | ||
49 | de->name); | ||
50 | free_proc_entry(de); | ||
51 | } | ||
52 | } | ||
53 | unlock_kernel(); | 48 | unlock_kernel(); |
54 | } | 49 | } |
55 | } | 50 | } |
diff --git a/fs/proc/proc_net.c b/fs/proc/proc_net.c index 131f9c68be5f..0afe21ee0607 100644 --- a/fs/proc/proc_net.c +++ b/fs/proc/proc_net.c | |||
@@ -50,89 +50,14 @@ struct net *get_proc_net(const struct inode *inode) | |||
50 | } | 50 | } |
51 | EXPORT_SYMBOL_GPL(get_proc_net); | 51 | EXPORT_SYMBOL_GPL(get_proc_net); |
52 | 52 | ||
53 | static struct proc_dir_entry *proc_net_shadow; | 53 | static struct proc_dir_entry *shadow_pde; |
54 | 54 | ||
55 | static struct dentry *proc_net_shadow_dentry(struct dentry *parent, | 55 | static struct proc_dir_entry *proc_net_shadow(struct task_struct *task, |
56 | struct proc_dir_entry *de) | 56 | struct proc_dir_entry *de) |
57 | { | 57 | { |
58 | struct dentry *shadow = NULL; | 58 | return task->nsproxy->net_ns->proc_net; |
59 | struct inode *inode; | ||
60 | if (!de) | ||
61 | goto out; | ||
62 | de_get(de); | ||
63 | inode = proc_get_inode(parent->d_inode->i_sb, de->low_ino, de); | ||
64 | if (!inode) | ||
65 | goto out_de_put; | ||
66 | shadow = d_alloc_name(parent, de->name); | ||
67 | if (!shadow) | ||
68 | goto out_iput; | ||
69 | shadow->d_op = parent->d_op; /* proc_dentry_operations */ | ||
70 | d_instantiate(shadow, inode); | ||
71 | out: | ||
72 | return shadow; | ||
73 | out_iput: | ||
74 | iput(inode); | ||
75 | out_de_put: | ||
76 | de_put(de); | ||
77 | goto out; | ||
78 | } | ||
79 | |||
80 | static void *proc_net_follow_link(struct dentry *parent, struct nameidata *nd) | ||
81 | { | ||
82 | struct net *net = current->nsproxy->net_ns; | ||
83 | struct dentry *shadow; | ||
84 | shadow = proc_net_shadow_dentry(parent, net->proc_net); | ||
85 | if (!shadow) | ||
86 | return ERR_PTR(-ENOENT); | ||
87 | |||
88 | dput(nd->dentry); | ||
89 | /* My dentry count is 1 and that should be enough as the | ||
90 | * shadow dentry is thrown away immediately. | ||
91 | */ | ||
92 | nd->dentry = shadow; | ||
93 | return NULL; | ||
94 | } | 59 | } |
95 | 60 | ||
96 | static struct dentry *proc_net_lookup(struct inode *dir, struct dentry *dentry, | ||
97 | struct nameidata *nd) | ||
98 | { | ||
99 | struct net *net = current->nsproxy->net_ns; | ||
100 | struct dentry *shadow; | ||
101 | |||
102 | shadow = proc_net_shadow_dentry(nd->dentry, net->proc_net); | ||
103 | if (!shadow) | ||
104 | return ERR_PTR(-ENOENT); | ||
105 | |||
106 | dput(nd->dentry); | ||
107 | nd->dentry = shadow; | ||
108 | |||
109 | return shadow->d_inode->i_op->lookup(shadow->d_inode, dentry, nd); | ||
110 | } | ||
111 | |||
112 | static int proc_net_setattr(struct dentry *dentry, struct iattr *iattr) | ||
113 | { | ||
114 | struct net *net = current->nsproxy->net_ns; | ||
115 | struct dentry *shadow; | ||
116 | int ret; | ||
117 | |||
118 | shadow = proc_net_shadow_dentry(dentry->d_parent, net->proc_net); | ||
119 | if (!shadow) | ||
120 | return -ENOENT; | ||
121 | ret = shadow->d_inode->i_op->setattr(shadow, iattr); | ||
122 | dput(shadow); | ||
123 | return ret; | ||
124 | } | ||
125 | |||
126 | static const struct file_operations proc_net_dir_operations = { | ||
127 | .read = generic_read_dir, | ||
128 | }; | ||
129 | |||
130 | static struct inode_operations proc_net_dir_inode_operations = { | ||
131 | .follow_link = proc_net_follow_link, | ||
132 | .lookup = proc_net_lookup, | ||
133 | .setattr = proc_net_setattr, | ||
134 | }; | ||
135 | |||
136 | static __net_init int proc_net_ns_init(struct net *net) | 61 | static __net_init int proc_net_ns_init(struct net *net) |
137 | { | 62 | { |
138 | struct proc_dir_entry *root, *netd, *net_statd; | 63 | struct proc_dir_entry *root, *netd, *net_statd; |
@@ -185,9 +110,8 @@ static struct pernet_operations __net_initdata proc_net_ns_ops = { | |||
185 | 110 | ||
186 | int __init proc_net_init(void) | 111 | int __init proc_net_init(void) |
187 | { | 112 | { |
188 | proc_net_shadow = proc_mkdir("net", NULL); | 113 | shadow_pde = proc_mkdir("net", NULL); |
189 | proc_net_shadow->proc_iops = &proc_net_dir_inode_operations; | 114 | shadow_pde->shadow_proc = proc_net_shadow; |
190 | proc_net_shadow->proc_fops = &proc_net_dir_operations; | ||
191 | 115 | ||
192 | return register_pernet_subsys(&proc_net_ns_ops); | 116 | return register_pernet_subsys(&proc_net_ns_ops); |
193 | } | 117 | } |
diff --git a/fs/proc/root.c b/fs/proc/root.c index ec9cb3b6c93b..81f99e691f99 100644 --- a/fs/proc/root.c +++ b/fs/proc/root.c | |||
@@ -207,6 +207,7 @@ struct proc_dir_entry proc_root = { | |||
207 | .name = "/proc", | 207 | .name = "/proc", |
208 | .mode = S_IFDIR | S_IRUGO | S_IXUGO, | 208 | .mode = S_IFDIR | S_IRUGO | S_IXUGO, |
209 | .nlink = 2, | 209 | .nlink = 2, |
210 | .count = ATOMIC_INIT(1), | ||
210 | .proc_iops = &proc_root_inode_operations, | 211 | .proc_iops = &proc_root_inode_operations, |
211 | .proc_fops = &proc_root_operations, | 212 | .proc_fops = &proc_root_operations, |
212 | .parent = &proc_root, | 213 | .parent = &proc_root, |
diff --git a/fs/reiserfs/procfs.c b/fs/reiserfs/procfs.c index 9aa7a06e093f..001144621672 100644 --- a/fs/reiserfs/procfs.c +++ b/fs/reiserfs/procfs.c | |||
@@ -420,12 +420,6 @@ static void *r_start(struct seq_file *m, loff_t * pos) | |||
420 | return NULL; | 420 | return NULL; |
421 | 421 | ||
422 | up_write(&s->s_umount); | 422 | up_write(&s->s_umount); |
423 | |||
424 | if (de->deleted) { | ||
425 | deactivate_super(s); | ||
426 | return NULL; | ||
427 | } | ||
428 | |||
429 | return s; | 423 | return s; |
430 | } | 424 | } |
431 | 425 | ||
diff --git a/fs/ufs/dir.c b/fs/ufs/dir.c index 30f8c2bb0c3e..aaf2878305ce 100644 --- a/fs/ufs/dir.c +++ b/fs/ufs/dir.c | |||
@@ -179,7 +179,7 @@ bad_entry: | |||
179 | goto fail; | 179 | goto fail; |
180 | Eend: | 180 | Eend: |
181 | p = (struct ufs_dir_entry *)(kaddr + offs); | 181 | p = (struct ufs_dir_entry *)(kaddr + offs); |
182 | ufs_error (sb, "ext2_check_page", | 182 | ufs_error(sb, __FUNCTION__, |
183 | "entry in directory #%lu spans the page boundary" | 183 | "entry in directory #%lu spans the page boundary" |
184 | "offset=%lu", | 184 | "offset=%lu", |
185 | dir->i_ino, (page->index<<PAGE_CACHE_SHIFT)+offs); | 185 | dir->i_ino, (page->index<<PAGE_CACHE_SHIFT)+offs); |
diff --git a/fs/ufs/super.c b/fs/ufs/super.c index c78c04fd993f..0072cb33ebec 100644 --- a/fs/ufs/super.c +++ b/fs/ufs/super.c | |||
@@ -755,13 +755,13 @@ static int ufs_fill_super(struct super_block *sb, void *data, int silent) | |||
755 | break; | 755 | break; |
756 | 756 | ||
757 | case UFS_MOUNT_UFSTYPE_NEXTSTEP: | 757 | case UFS_MOUNT_UFSTYPE_NEXTSTEP: |
758 | /*TODO: check may be we need set special dir block size?*/ | ||
759 | UFSD("ufstype=nextstep\n"); | 758 | UFSD("ufstype=nextstep\n"); |
760 | uspi->s_fsize = block_size = 1024; | 759 | uspi->s_fsize = block_size = 1024; |
761 | uspi->s_fmask = ~(1024 - 1); | 760 | uspi->s_fmask = ~(1024 - 1); |
762 | uspi->s_fshift = 10; | 761 | uspi->s_fshift = 10; |
763 | uspi->s_sbsize = super_block_size = 2048; | 762 | uspi->s_sbsize = super_block_size = 2048; |
764 | uspi->s_sbbase = 0; | 763 | uspi->s_sbbase = 0; |
764 | uspi->s_dirblksize = 1024; | ||
765 | flags |= UFS_DE_OLD | UFS_UID_OLD | UFS_ST_OLD | UFS_CG_OLD; | 765 | flags |= UFS_DE_OLD | UFS_UID_OLD | UFS_ST_OLD | UFS_CG_OLD; |
766 | if (!(sb->s_flags & MS_RDONLY)) { | 766 | if (!(sb->s_flags & MS_RDONLY)) { |
767 | if (!silent) | 767 | if (!silent) |
@@ -771,13 +771,13 @@ static int ufs_fill_super(struct super_block *sb, void *data, int silent) | |||
771 | break; | 771 | break; |
772 | 772 | ||
773 | case UFS_MOUNT_UFSTYPE_NEXTSTEP_CD: | 773 | case UFS_MOUNT_UFSTYPE_NEXTSTEP_CD: |
774 | /*TODO: check may be we need set special dir block size?*/ | ||
775 | UFSD("ufstype=nextstep-cd\n"); | 774 | UFSD("ufstype=nextstep-cd\n"); |
776 | uspi->s_fsize = block_size = 2048; | 775 | uspi->s_fsize = block_size = 2048; |
777 | uspi->s_fmask = ~(2048 - 1); | 776 | uspi->s_fmask = ~(2048 - 1); |
778 | uspi->s_fshift = 11; | 777 | uspi->s_fshift = 11; |
779 | uspi->s_sbsize = super_block_size = 2048; | 778 | uspi->s_sbsize = super_block_size = 2048; |
780 | uspi->s_sbbase = 0; | 779 | uspi->s_sbbase = 0; |
780 | uspi->s_dirblksize = 1024; | ||
781 | flags |= UFS_DE_OLD | UFS_UID_OLD | UFS_ST_OLD | UFS_CG_OLD; | 781 | flags |= UFS_DE_OLD | UFS_UID_OLD | UFS_ST_OLD | UFS_CG_OLD; |
782 | if (!(sb->s_flags & MS_RDONLY)) { | 782 | if (!(sb->s_flags & MS_RDONLY)) { |
783 | if (!silent) | 783 | if (!silent) |