diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/aio.c | 8 | ||||
-rw-r--r-- | fs/bio.c | 2 | ||||
-rw-r--r-- | fs/buffer.c | 4 | ||||
-rw-r--r-- | fs/dquot.c | 2 | ||||
-rw-r--r-- | fs/ecryptfs/dentry.c | 2 | ||||
-rw-r--r-- | fs/ext3/acl.c | 8 | ||||
-rw-r--r-- | fs/ext3/resize.c | 4 | ||||
-rw-r--r-- | fs/ext3/xattr.c | 4 | ||||
-rw-r--r-- | fs/fs-writeback.c | 6 | ||||
-rw-r--r-- | fs/hfs/brec.c | 18 | ||||
-rw-r--r-- | fs/isofs/compress.c | 11 | ||||
-rw-r--r-- | fs/jbd/journal.c | 5 | ||||
-rw-r--r-- | fs/jbd/recovery.c | 2 | ||||
-rw-r--r-- | fs/jbd/transaction.c | 8 | ||||
-rw-r--r-- | fs/jbd2/recovery.c | 2 | ||||
-rw-r--r-- | fs/locks.c | 4 | ||||
-rw-r--r-- | fs/namei.c | 6 | ||||
-rw-r--r-- | fs/nfs/read.c | 5 | ||||
-rw-r--r-- | fs/nfs/write.c | 8 | ||||
-rw-r--r-- | fs/nfsd/nfsfh.c | 4 | ||||
-rw-r--r-- | fs/proc/base.c | 25 | ||||
-rw-r--r-- | fs/proc/generic.c | 26 | ||||
-rw-r--r-- | fs/proc/internal.h | 7 | ||||
-rw-r--r-- | fs/proc/proc_net.c | 117 | ||||
-rw-r--r-- | fs/proc/task_mmu.c | 18 | ||||
-rw-r--r-- | fs/romfs/inode.c | 30 | ||||
-rw-r--r-- | fs/super.c | 6 | ||||
-rw-r--r-- | fs/ufs/balloc.c | 4 |
28 files changed, 245 insertions, 101 deletions
@@ -996,6 +996,14 @@ put_rq: | |||
996 | /* everything turned out well, dispose of the aiocb. */ | 996 | /* everything turned out well, dispose of the aiocb. */ |
997 | ret = __aio_put_req(ctx, iocb); | 997 | ret = __aio_put_req(ctx, iocb); |
998 | 998 | ||
999 | /* | ||
1000 | * We have to order our ring_info tail store above and test | ||
1001 | * of the wait list below outside the wait lock. This is | ||
1002 | * like in wake_up_bit() where clearing a bit has to be | ||
1003 | * ordered with the unlocked test. | ||
1004 | */ | ||
1005 | smp_mb(); | ||
1006 | |||
999 | if (waitqueue_active(&ctx->wait)) | 1007 | if (waitqueue_active(&ctx->wait)) |
1000 | wake_up(&ctx->wait); | 1008 | wake_up(&ctx->wait); |
1001 | 1009 | ||
@@ -1194,6 +1194,8 @@ EXPORT_SYMBOL(bio_hw_segments); | |||
1194 | EXPORT_SYMBOL(bio_add_page); | 1194 | EXPORT_SYMBOL(bio_add_page); |
1195 | EXPORT_SYMBOL(bio_add_pc_page); | 1195 | EXPORT_SYMBOL(bio_add_pc_page); |
1196 | EXPORT_SYMBOL(bio_get_nr_vecs); | 1196 | EXPORT_SYMBOL(bio_get_nr_vecs); |
1197 | EXPORT_SYMBOL(bio_map_user); | ||
1198 | EXPORT_SYMBOL(bio_unmap_user); | ||
1197 | EXPORT_SYMBOL(bio_map_kern); | 1199 | EXPORT_SYMBOL(bio_map_kern); |
1198 | EXPORT_SYMBOL(bio_pair_release); | 1200 | EXPORT_SYMBOL(bio_pair_release); |
1199 | EXPORT_SYMBOL(bio_split); | 1201 | EXPORT_SYMBOL(bio_split); |
diff --git a/fs/buffer.c b/fs/buffer.c index ddfdd2c80bf9..7ba58386beee 100644 --- a/fs/buffer.c +++ b/fs/buffer.c | |||
@@ -3213,7 +3213,7 @@ static int buffer_cpu_notify(struct notifier_block *self, | |||
3213 | } | 3213 | } |
3214 | 3214 | ||
3215 | /** | 3215 | /** |
3216 | * bh_uptodate_or_lock: Test whether the buffer is uptodate | 3216 | * bh_uptodate_or_lock - Test whether the buffer is uptodate |
3217 | * @bh: struct buffer_head | 3217 | * @bh: struct buffer_head |
3218 | * | 3218 | * |
3219 | * Return true if the buffer is up-to-date and false, | 3219 | * Return true if the buffer is up-to-date and false, |
@@ -3232,7 +3232,7 @@ int bh_uptodate_or_lock(struct buffer_head *bh) | |||
3232 | EXPORT_SYMBOL(bh_uptodate_or_lock); | 3232 | EXPORT_SYMBOL(bh_uptodate_or_lock); |
3233 | 3233 | ||
3234 | /** | 3234 | /** |
3235 | * bh_submit_read: Submit a locked buffer for reading | 3235 | * bh_submit_read - Submit a locked buffer for reading |
3236 | * @bh: struct buffer_head | 3236 | * @bh: struct buffer_head |
3237 | * | 3237 | * |
3238 | * Returns zero on success and -EIO on error. | 3238 | * Returns zero on success and -EIO on error. |
diff --git a/fs/dquot.c b/fs/dquot.c index 9c7feb62eed1..41b9dbd68b0e 100644 --- a/fs/dquot.c +++ b/fs/dquot.c | |||
@@ -1522,8 +1522,8 @@ int vfs_quota_off(struct super_block *sb, int type) | |||
1522 | truncate_inode_pages(&toputinode[cnt]->i_data, 0); | 1522 | truncate_inode_pages(&toputinode[cnt]->i_data, 0); |
1523 | mutex_unlock(&toputinode[cnt]->i_mutex); | 1523 | mutex_unlock(&toputinode[cnt]->i_mutex); |
1524 | mark_inode_dirty(toputinode[cnt]); | 1524 | mark_inode_dirty(toputinode[cnt]); |
1525 | iput(toputinode[cnt]); | ||
1526 | } | 1525 | } |
1526 | iput(toputinode[cnt]); | ||
1527 | mutex_unlock(&dqopt->dqonoff_mutex); | 1527 | mutex_unlock(&dqopt->dqonoff_mutex); |
1528 | } | 1528 | } |
1529 | if (sb->s_bdev) | 1529 | if (sb->s_bdev) |
diff --git a/fs/ecryptfs/dentry.c b/fs/ecryptfs/dentry.c index 841a032050a7..5e596583946c 100644 --- a/fs/ecryptfs/dentry.c +++ b/fs/ecryptfs/dentry.c | |||
@@ -80,8 +80,8 @@ static void ecryptfs_d_release(struct dentry *dentry) | |||
80 | { | 80 | { |
81 | if (ecryptfs_dentry_to_private(dentry)) { | 81 | if (ecryptfs_dentry_to_private(dentry)) { |
82 | if (ecryptfs_dentry_to_lower(dentry)) { | 82 | if (ecryptfs_dentry_to_lower(dentry)) { |
83 | mntput(ecryptfs_dentry_to_lower_mnt(dentry)); | ||
84 | dput(ecryptfs_dentry_to_lower(dentry)); | 83 | dput(ecryptfs_dentry_to_lower(dentry)); |
84 | mntput(ecryptfs_dentry_to_lower_mnt(dentry)); | ||
85 | } | 85 | } |
86 | kmem_cache_free(ecryptfs_dentry_info_cache, | 86 | kmem_cache_free(ecryptfs_dentry_info_cache, |
87 | ecryptfs_dentry_to_private(dentry)); | 87 | ecryptfs_dentry_to_private(dentry)); |
diff --git a/fs/ext3/acl.c b/fs/ext3/acl.c index d34e9967430a..a754d1848173 100644 --- a/fs/ext3/acl.c +++ b/fs/ext3/acl.c | |||
@@ -37,7 +37,7 @@ ext3_acl_from_disk(const void *value, size_t size) | |||
37 | return ERR_PTR(-EINVAL); | 37 | return ERR_PTR(-EINVAL); |
38 | if (count == 0) | 38 | if (count == 0) |
39 | return NULL; | 39 | return NULL; |
40 | acl = posix_acl_alloc(count, GFP_KERNEL); | 40 | acl = posix_acl_alloc(count, GFP_NOFS); |
41 | if (!acl) | 41 | if (!acl) |
42 | return ERR_PTR(-ENOMEM); | 42 | return ERR_PTR(-ENOMEM); |
43 | for (n=0; n < count; n++) { | 43 | for (n=0; n < count; n++) { |
@@ -91,7 +91,7 @@ ext3_acl_to_disk(const struct posix_acl *acl, size_t *size) | |||
91 | 91 | ||
92 | *size = ext3_acl_size(acl->a_count); | 92 | *size = ext3_acl_size(acl->a_count); |
93 | ext_acl = kmalloc(sizeof(ext3_acl_header) + acl->a_count * | 93 | ext_acl = kmalloc(sizeof(ext3_acl_header) + acl->a_count * |
94 | sizeof(ext3_acl_entry), GFP_KERNEL); | 94 | sizeof(ext3_acl_entry), GFP_NOFS); |
95 | if (!ext_acl) | 95 | if (!ext_acl) |
96 | return ERR_PTR(-ENOMEM); | 96 | return ERR_PTR(-ENOMEM); |
97 | ext_acl->a_version = cpu_to_le32(EXT3_ACL_VERSION); | 97 | ext_acl->a_version = cpu_to_le32(EXT3_ACL_VERSION); |
@@ -187,7 +187,7 @@ ext3_get_acl(struct inode *inode, int type) | |||
187 | } | 187 | } |
188 | retval = ext3_xattr_get(inode, name_index, "", NULL, 0); | 188 | retval = ext3_xattr_get(inode, name_index, "", NULL, 0); |
189 | if (retval > 0) { | 189 | if (retval > 0) { |
190 | value = kmalloc(retval, GFP_KERNEL); | 190 | value = kmalloc(retval, GFP_NOFS); |
191 | if (!value) | 191 | if (!value) |
192 | return ERR_PTR(-ENOMEM); | 192 | return ERR_PTR(-ENOMEM); |
193 | retval = ext3_xattr_get(inode, name_index, "", value, retval); | 193 | retval = ext3_xattr_get(inode, name_index, "", value, retval); |
@@ -335,7 +335,7 @@ ext3_init_acl(handle_t *handle, struct inode *inode, struct inode *dir) | |||
335 | if (error) | 335 | if (error) |
336 | goto cleanup; | 336 | goto cleanup; |
337 | } | 337 | } |
338 | clone = posix_acl_clone(acl, GFP_KERNEL); | 338 | clone = posix_acl_clone(acl, GFP_NOFS); |
339 | error = -ENOMEM; | 339 | error = -ENOMEM; |
340 | if (!clone) | 340 | if (!clone) |
341 | goto cleanup; | 341 | goto cleanup; |
diff --git a/fs/ext3/resize.c b/fs/ext3/resize.c index 9397d779c43d..0e97b6e07cb0 100644 --- a/fs/ext3/resize.c +++ b/fs/ext3/resize.c | |||
@@ -485,7 +485,7 @@ static int add_new_gdb(handle_t *handle, struct inode *inode, | |||
485 | goto exit_dindj; | 485 | goto exit_dindj; |
486 | 486 | ||
487 | n_group_desc = kmalloc((gdb_num + 1) * sizeof(struct buffer_head *), | 487 | n_group_desc = kmalloc((gdb_num + 1) * sizeof(struct buffer_head *), |
488 | GFP_KERNEL); | 488 | GFP_NOFS); |
489 | if (!n_group_desc) { | 489 | if (!n_group_desc) { |
490 | err = -ENOMEM; | 490 | err = -ENOMEM; |
491 | ext3_warning (sb, __FUNCTION__, | 491 | ext3_warning (sb, __FUNCTION__, |
@@ -568,7 +568,7 @@ static int reserve_backup_gdb(handle_t *handle, struct inode *inode, | |||
568 | int res, i; | 568 | int res, i; |
569 | int err; | 569 | int err; |
570 | 570 | ||
571 | primary = kmalloc(reserved_gdb * sizeof(*primary), GFP_KERNEL); | 571 | primary = kmalloc(reserved_gdb * sizeof(*primary), GFP_NOFS); |
572 | if (!primary) | 572 | if (!primary) |
573 | return -ENOMEM; | 573 | return -ENOMEM; |
574 | 574 | ||
diff --git a/fs/ext3/xattr.c b/fs/ext3/xattr.c index fb89c299bece..a6ea4d6a8bb2 100644 --- a/fs/ext3/xattr.c +++ b/fs/ext3/xattr.c | |||
@@ -728,7 +728,7 @@ ext3_xattr_block_set(handle_t *handle, struct inode *inode, | |||
728 | ce = NULL; | 728 | ce = NULL; |
729 | } | 729 | } |
730 | ea_bdebug(bs->bh, "cloning"); | 730 | ea_bdebug(bs->bh, "cloning"); |
731 | s->base = kmalloc(bs->bh->b_size, GFP_KERNEL); | 731 | s->base = kmalloc(bs->bh->b_size, GFP_NOFS); |
732 | error = -ENOMEM; | 732 | error = -ENOMEM; |
733 | if (s->base == NULL) | 733 | if (s->base == NULL) |
734 | goto cleanup; | 734 | goto cleanup; |
@@ -740,7 +740,7 @@ ext3_xattr_block_set(handle_t *handle, struct inode *inode, | |||
740 | } | 740 | } |
741 | } else { | 741 | } else { |
742 | /* Allocate a buffer where we construct the new block. */ | 742 | /* Allocate a buffer where we construct the new block. */ |
743 | s->base = kzalloc(sb->s_blocksize, GFP_KERNEL); | 743 | s->base = kzalloc(sb->s_blocksize, GFP_NOFS); |
744 | /* assert(header == s->base) */ | 744 | /* assert(header == s->base) */ |
745 | error = -ENOMEM; | 745 | error = -ENOMEM; |
746 | if (s->base == NULL) | 746 | if (s->base == NULL) |
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index c0076077d338..06557679ca41 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c | |||
@@ -751,7 +751,7 @@ int generic_osync_inode(struct inode *inode, struct address_space *mapping, int | |||
751 | EXPORT_SYMBOL(generic_osync_inode); | 751 | EXPORT_SYMBOL(generic_osync_inode); |
752 | 752 | ||
753 | /** | 753 | /** |
754 | * writeback_acquire: attempt to get exclusive writeback access to a device | 754 | * writeback_acquire - attempt to get exclusive writeback access to a device |
755 | * @bdi: the device's backing_dev_info structure | 755 | * @bdi: the device's backing_dev_info structure |
756 | * | 756 | * |
757 | * It is a waste of resources to have more than one pdflush thread blocked on | 757 | * It is a waste of resources to have more than one pdflush thread blocked on |
@@ -768,7 +768,7 @@ int writeback_acquire(struct backing_dev_info *bdi) | |||
768 | } | 768 | } |
769 | 769 | ||
770 | /** | 770 | /** |
771 | * writeback_in_progress: determine whether there is writeback in progress | 771 | * writeback_in_progress - determine whether there is writeback in progress |
772 | * @bdi: the device's backing_dev_info structure. | 772 | * @bdi: the device's backing_dev_info structure. |
773 | * | 773 | * |
774 | * Determine whether there is writeback in progress against a backing device. | 774 | * Determine whether there is writeback in progress against a backing device. |
@@ -779,7 +779,7 @@ int writeback_in_progress(struct backing_dev_info *bdi) | |||
779 | } | 779 | } |
780 | 780 | ||
781 | /** | 781 | /** |
782 | * writeback_release: relinquish exclusive writeback access against a device. | 782 | * writeback_release - relinquish exclusive writeback access against a device. |
783 | * @bdi: the device's backing_dev_info structure | 783 | * @bdi: the device's backing_dev_info structure |
784 | */ | 784 | */ |
785 | void writeback_release(struct backing_dev_info *bdi) | 785 | void writeback_release(struct backing_dev_info *bdi) |
diff --git a/fs/hfs/brec.c b/fs/hfs/brec.c index 878bf25dbc6a..92fb358ce824 100644 --- a/fs/hfs/brec.c +++ b/fs/hfs/brec.c | |||
@@ -229,7 +229,7 @@ skip: | |||
229 | static struct hfs_bnode *hfs_bnode_split(struct hfs_find_data *fd) | 229 | static struct hfs_bnode *hfs_bnode_split(struct hfs_find_data *fd) |
230 | { | 230 | { |
231 | struct hfs_btree *tree; | 231 | struct hfs_btree *tree; |
232 | struct hfs_bnode *node, *new_node; | 232 | struct hfs_bnode *node, *new_node, *next_node; |
233 | struct hfs_bnode_desc node_desc; | 233 | struct hfs_bnode_desc node_desc; |
234 | int num_recs, new_rec_off, new_off, old_rec_off; | 234 | int num_recs, new_rec_off, new_off, old_rec_off; |
235 | int data_start, data_end, size; | 235 | int data_start, data_end, size; |
@@ -248,6 +248,17 @@ static struct hfs_bnode *hfs_bnode_split(struct hfs_find_data *fd) | |||
248 | new_node->type = node->type; | 248 | new_node->type = node->type; |
249 | new_node->height = node->height; | 249 | new_node->height = node->height; |
250 | 250 | ||
251 | if (node->next) | ||
252 | next_node = hfs_bnode_find(tree, node->next); | ||
253 | else | ||
254 | next_node = NULL; | ||
255 | |||
256 | if (IS_ERR(next_node)) { | ||
257 | hfs_bnode_put(node); | ||
258 | hfs_bnode_put(new_node); | ||
259 | return next_node; | ||
260 | } | ||
261 | |||
251 | size = tree->node_size / 2 - node->num_recs * 2 - 14; | 262 | size = tree->node_size / 2 - node->num_recs * 2 - 14; |
252 | old_rec_off = tree->node_size - 4; | 263 | old_rec_off = tree->node_size - 4; |
253 | num_recs = 1; | 264 | num_recs = 1; |
@@ -261,6 +272,8 @@ static struct hfs_bnode *hfs_bnode_split(struct hfs_find_data *fd) | |||
261 | /* panic? */ | 272 | /* panic? */ |
262 | hfs_bnode_put(node); | 273 | hfs_bnode_put(node); |
263 | hfs_bnode_put(new_node); | 274 | hfs_bnode_put(new_node); |
275 | if (next_node) | ||
276 | hfs_bnode_put(next_node); | ||
264 | return ERR_PTR(-ENOSPC); | 277 | return ERR_PTR(-ENOSPC); |
265 | } | 278 | } |
266 | 279 | ||
@@ -315,8 +328,7 @@ static struct hfs_bnode *hfs_bnode_split(struct hfs_find_data *fd) | |||
315 | hfs_bnode_write(node, &node_desc, 0, sizeof(node_desc)); | 328 | hfs_bnode_write(node, &node_desc, 0, sizeof(node_desc)); |
316 | 329 | ||
317 | /* update next bnode header */ | 330 | /* update next bnode header */ |
318 | if (new_node->next) { | 331 | if (next_node) { |
319 | struct hfs_bnode *next_node = hfs_bnode_find(tree, new_node->next); | ||
320 | next_node->prev = new_node->this; | 332 | next_node->prev = new_node->this; |
321 | hfs_bnode_read(next_node, &node_desc, 0, sizeof(node_desc)); | 333 | hfs_bnode_read(next_node, &node_desc, 0, sizeof(node_desc)); |
322 | node_desc.prev = cpu_to_be32(next_node->prev); | 334 | node_desc.prev = cpu_to_be32(next_node->prev); |
diff --git a/fs/isofs/compress.c b/fs/isofs/compress.c index 37dbd6404787..defb932eee9a 100644 --- a/fs/isofs/compress.c +++ b/fs/isofs/compress.c | |||
@@ -72,6 +72,17 @@ static int zisofs_readpage(struct file *file, struct page *page) | |||
72 | offset = index & ~zisofs_block_page_mask; | 72 | offset = index & ~zisofs_block_page_mask; |
73 | blockindex = offset >> zisofs_block_page_shift; | 73 | blockindex = offset >> zisofs_block_page_shift; |
74 | maxpage = (inode->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; | 74 | maxpage = (inode->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; |
75 | |||
76 | /* | ||
77 | * If this page is wholly outside i_size we just return zero; | ||
78 | * do_generic_file_read() will handle this for us | ||
79 | */ | ||
80 | if (page->index >= maxpage) { | ||
81 | SetPageUptodate(page); | ||
82 | unlock_page(page); | ||
83 | return 0; | ||
84 | } | ||
85 | |||
75 | maxpage = min(zisofs_block_pages, maxpage-offset); | 86 | maxpage = min(zisofs_block_pages, maxpage-offset); |
76 | 87 | ||
77 | for ( i = 0 ; i < maxpage ; i++, offset++ ) { | 88 | for ( i = 0 ; i < maxpage ; i++, offset++ ) { |
diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c index 3943a8905eb2..9816293442ab 100644 --- a/fs/jbd/journal.c +++ b/fs/jbd/journal.c | |||
@@ -697,13 +697,14 @@ fail: | |||
697 | */ | 697 | */ |
698 | 698 | ||
699 | /** | 699 | /** |
700 | * journal_t * journal_init_dev() - creates an initialises a journal structure | 700 | * journal_t * journal_init_dev() - creates and initialises a journal structure |
701 | * @bdev: Block device on which to create the journal | 701 | * @bdev: Block device on which to create the journal |
702 | * @fs_dev: Device which hold journalled filesystem for this journal. | 702 | * @fs_dev: Device which hold journalled filesystem for this journal. |
703 | * @start: Block nr Start of journal. | 703 | * @start: Block nr Start of journal. |
704 | * @len: Length of the journal in blocks. | 704 | * @len: Length of the journal in blocks. |
705 | * @blocksize: blocksize of journalling device | 705 | * @blocksize: blocksize of journalling device |
706 | * @returns: a newly created journal_t * | 706 | * |
707 | * Returns: a newly created journal_t * | ||
707 | * | 708 | * |
708 | * journal_init_dev creates a journal which maps a fixed contiguous | 709 | * journal_init_dev creates a journal which maps a fixed contiguous |
709 | * range of blocks on an arbitrary block device. | 710 | * range of blocks on an arbitrary block device. |
diff --git a/fs/jbd/recovery.c b/fs/jbd/recovery.c index 2b8edf4d6eaa..43bc5e5ed064 100644 --- a/fs/jbd/recovery.c +++ b/fs/jbd/recovery.c | |||
@@ -478,7 +478,7 @@ static int do_one_pass(journal_t *journal, | |||
478 | memcpy(nbh->b_data, obh->b_data, | 478 | memcpy(nbh->b_data, obh->b_data, |
479 | journal->j_blocksize); | 479 | journal->j_blocksize); |
480 | if (flags & JFS_FLAG_ESCAPE) { | 480 | if (flags & JFS_FLAG_ESCAPE) { |
481 | *((__be32 *)bh->b_data) = | 481 | *((__be32 *)nbh->b_data) = |
482 | cpu_to_be32(JFS_MAGIC_NUMBER); | 482 | cpu_to_be32(JFS_MAGIC_NUMBER); |
483 | } | 483 | } |
484 | 484 | ||
diff --git a/fs/jbd/transaction.c b/fs/jbd/transaction.c index c6cbb6cd59b2..2c9e8f5d13aa 100644 --- a/fs/jbd/transaction.c +++ b/fs/jbd/transaction.c | |||
@@ -1426,7 +1426,8 @@ int journal_stop(handle_t *handle) | |||
1426 | return err; | 1426 | return err; |
1427 | } | 1427 | } |
1428 | 1428 | ||
1429 | /**int journal_force_commit() - force any uncommitted transactions | 1429 | /** |
1430 | * int journal_force_commit() - force any uncommitted transactions | ||
1430 | * @journal: journal to force | 1431 | * @journal: journal to force |
1431 | * | 1432 | * |
1432 | * For synchronous operations: force any uncommitted transactions | 1433 | * For synchronous operations: force any uncommitted transactions |
@@ -1903,13 +1904,12 @@ zap_buffer_unlocked: | |||
1903 | } | 1904 | } |
1904 | 1905 | ||
1905 | /** | 1906 | /** |
1906 | * void journal_invalidatepage() | 1907 | * void journal_invalidatepage() - invalidate a journal page |
1907 | * @journal: journal to use for flush... | 1908 | * @journal: journal to use for flush |
1908 | * @page: page to flush | 1909 | * @page: page to flush |
1909 | * @offset: length of page to invalidate. | 1910 | * @offset: length of page to invalidate. |
1910 | * | 1911 | * |
1911 | * Reap page buffers containing data after offset in page. | 1912 | * Reap page buffers containing data after offset in page. |
1912 | * | ||
1913 | */ | 1913 | */ |
1914 | void journal_invalidatepage(journal_t *journal, | 1914 | void journal_invalidatepage(journal_t *journal, |
1915 | struct page *page, | 1915 | struct page *page, |
diff --git a/fs/jbd2/recovery.c b/fs/jbd2/recovery.c index 146411387ada..5d0405a9e7ca 100644 --- a/fs/jbd2/recovery.c +++ b/fs/jbd2/recovery.c | |||
@@ -535,7 +535,7 @@ static int do_one_pass(journal_t *journal, | |||
535 | memcpy(nbh->b_data, obh->b_data, | 535 | memcpy(nbh->b_data, obh->b_data, |
536 | journal->j_blocksize); | 536 | journal->j_blocksize); |
537 | if (flags & JBD2_FLAG_ESCAPE) { | 537 | if (flags & JBD2_FLAG_ESCAPE) { |
538 | *((__be32 *)bh->b_data) = | 538 | *((__be32 *)nbh->b_data) = |
539 | cpu_to_be32(JBD2_MAGIC_NUMBER); | 539 | cpu_to_be32(JBD2_MAGIC_NUMBER); |
540 | } | 540 | } |
541 | 541 | ||
diff --git a/fs/locks.c b/fs/locks.c index f36f0e61558d..d83fab1b77b5 100644 --- a/fs/locks.c +++ b/fs/locks.c | |||
@@ -1275,13 +1275,13 @@ out: | |||
1275 | EXPORT_SYMBOL(__break_lease); | 1275 | EXPORT_SYMBOL(__break_lease); |
1276 | 1276 | ||
1277 | /** | 1277 | /** |
1278 | * lease_get_mtime | 1278 | * lease_get_mtime - get the last modified time of an inode |
1279 | * @inode: the inode | 1279 | * @inode: the inode |
1280 | * @time: pointer to a timespec which will contain the last modified time | 1280 | * @time: pointer to a timespec which will contain the last modified time |
1281 | * | 1281 | * |
1282 | * This is to force NFS clients to flush their caches for files with | 1282 | * This is to force NFS clients to flush their caches for files with |
1283 | * exclusive leases. The justification is that if someone has an | 1283 | * exclusive leases. The justification is that if someone has an |
1284 | * exclusive lease, then they could be modifiying it. | 1284 | * exclusive lease, then they could be modifying it. |
1285 | */ | 1285 | */ |
1286 | void lease_get_mtime(struct inode *inode, struct timespec *time) | 1286 | void lease_get_mtime(struct inode *inode, struct timespec *time) |
1287 | { | 1287 | { |
diff --git a/fs/namei.c b/fs/namei.c index 941c8e8228c0..6b7a0eef4090 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -1364,13 +1364,13 @@ static int __lookup_one_len(const char *name, struct qstr *this, | |||
1364 | } | 1364 | } |
1365 | 1365 | ||
1366 | /** | 1366 | /** |
1367 | * lookup_one_len: filesystem helper to lookup single pathname component | 1367 | * lookup_one_len - filesystem helper to lookup single pathname component |
1368 | * @name: pathname component to lookup | 1368 | * @name: pathname component to lookup |
1369 | * @base: base directory to lookup from | 1369 | * @base: base directory to lookup from |
1370 | * @len: maximum length @len should be interpreted to | 1370 | * @len: maximum length @len should be interpreted to |
1371 | * | 1371 | * |
1372 | * Note that this routine is purely a helper for filesystem useage and should | 1372 | * Note that this routine is purely a helper for filesystem usage and should |
1373 | * not be called by generic code. Also note that by using this function to | 1373 | * not be called by generic code. Also note that by using this function the |
1374 | * nameidata argument is passed to the filesystem methods and a filesystem | 1374 | * nameidata argument is passed to the filesystem methods and a filesystem |
1375 | * using this helper needs to be prepared for that. | 1375 | * using this helper needs to be prepared for that. |
1376 | */ | 1376 | */ |
diff --git a/fs/nfs/read.c b/fs/nfs/read.c index 3d7d9631e125..5a70be589bbe 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c | |||
@@ -533,7 +533,10 @@ readpage_async_filler(void *data, struct page *page) | |||
533 | 533 | ||
534 | if (len < PAGE_CACHE_SIZE) | 534 | if (len < PAGE_CACHE_SIZE) |
535 | zero_user_segment(page, len, PAGE_CACHE_SIZE); | 535 | zero_user_segment(page, len, PAGE_CACHE_SIZE); |
536 | nfs_pageio_add_request(desc->pgio, new); | 536 | if (!nfs_pageio_add_request(desc->pgio, new)) { |
537 | error = desc->pgio->pg_error; | ||
538 | goto out_unlock; | ||
539 | } | ||
537 | return 0; | 540 | return 0; |
538 | out_error: | 541 | out_error: |
539 | error = PTR_ERR(new); | 542 | error = PTR_ERR(new); |
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 80c61fdb2720..bed63416a55b 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -39,6 +39,7 @@ static struct nfs_page * nfs_update_request(struct nfs_open_context*, | |||
39 | unsigned int, unsigned int); | 39 | unsigned int, unsigned int); |
40 | static void nfs_pageio_init_write(struct nfs_pageio_descriptor *desc, | 40 | static void nfs_pageio_init_write(struct nfs_pageio_descriptor *desc, |
41 | struct inode *inode, int ioflags); | 41 | struct inode *inode, int ioflags); |
42 | static void nfs_redirty_request(struct nfs_page *req); | ||
42 | static const struct rpc_call_ops nfs_write_partial_ops; | 43 | static const struct rpc_call_ops nfs_write_partial_ops; |
43 | static const struct rpc_call_ops nfs_write_full_ops; | 44 | static const struct rpc_call_ops nfs_write_full_ops; |
44 | static const struct rpc_call_ops nfs_commit_ops; | 45 | static const struct rpc_call_ops nfs_commit_ops; |
@@ -288,7 +289,12 @@ static int nfs_page_async_flush(struct nfs_pageio_descriptor *pgio, | |||
288 | BUG(); | 289 | BUG(); |
289 | } | 290 | } |
290 | spin_unlock(&inode->i_lock); | 291 | spin_unlock(&inode->i_lock); |
291 | nfs_pageio_add_request(pgio, req); | 292 | if (!nfs_pageio_add_request(pgio, req)) { |
293 | nfs_redirty_request(req); | ||
294 | nfs_end_page_writeback(page); | ||
295 | nfs_clear_page_tag_locked(req); | ||
296 | return pgio->pg_error; | ||
297 | } | ||
292 | return 0; | 298 | return 0; |
293 | } | 299 | } |
294 | 300 | ||
diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c index 1eb771d79cca..3e6b3f41ee1f 100644 --- a/fs/nfsd/nfsfh.c +++ b/fs/nfsd/nfsfh.c | |||
@@ -232,6 +232,7 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access) | |||
232 | fhp->fh_dentry = dentry; | 232 | fhp->fh_dentry = dentry; |
233 | fhp->fh_export = exp; | 233 | fhp->fh_export = exp; |
234 | nfsd_nr_verified++; | 234 | nfsd_nr_verified++; |
235 | cache_get(&exp->h); | ||
235 | } else { | 236 | } else { |
236 | /* | 237 | /* |
237 | * just rechecking permissions | 238 | * just rechecking permissions |
@@ -241,6 +242,7 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access) | |||
241 | dprintk("nfsd: fh_verify - just checking\n"); | 242 | dprintk("nfsd: fh_verify - just checking\n"); |
242 | dentry = fhp->fh_dentry; | 243 | dentry = fhp->fh_dentry; |
243 | exp = fhp->fh_export; | 244 | exp = fhp->fh_export; |
245 | cache_get(&exp->h); | ||
244 | /* | 246 | /* |
245 | * Set user creds for this exportpoint; necessary even | 247 | * Set user creds for this exportpoint; necessary even |
246 | * in the "just checking" case because this may be a | 248 | * in the "just checking" case because this may be a |
@@ -252,8 +254,6 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access) | |||
252 | if (error) | 254 | if (error) |
253 | goto out; | 255 | goto out; |
254 | } | 256 | } |
255 | cache_get(&exp->h); | ||
256 | |||
257 | 257 | ||
258 | error = nfsd_mode_check(rqstp, dentry->d_inode->i_mode, type); | 258 | error = nfsd_mode_check(rqstp, dentry->d_inode->i_mode, type); |
259 | if (error) | 259 | if (error) |
diff --git a/fs/proc/base.c b/fs/proc/base.c index 91a1bd67ac1d..8a10f6fe24a1 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -1036,6 +1036,26 @@ static const struct file_operations proc_loginuid_operations = { | |||
1036 | .read = proc_loginuid_read, | 1036 | .read = proc_loginuid_read, |
1037 | .write = proc_loginuid_write, | 1037 | .write = proc_loginuid_write, |
1038 | }; | 1038 | }; |
1039 | |||
1040 | static ssize_t proc_sessionid_read(struct file * file, char __user * buf, | ||
1041 | size_t count, loff_t *ppos) | ||
1042 | { | ||
1043 | struct inode * inode = file->f_path.dentry->d_inode; | ||
1044 | struct task_struct *task = get_proc_task(inode); | ||
1045 | ssize_t length; | ||
1046 | char tmpbuf[TMPBUFLEN]; | ||
1047 | |||
1048 | if (!task) | ||
1049 | return -ESRCH; | ||
1050 | length = scnprintf(tmpbuf, TMPBUFLEN, "%u", | ||
1051 | audit_get_sessionid(task)); | ||
1052 | put_task_struct(task); | ||
1053 | return simple_read_from_buffer(buf, count, ppos, tmpbuf, length); | ||
1054 | } | ||
1055 | |||
1056 | static const struct file_operations proc_sessionid_operations = { | ||
1057 | .read = proc_sessionid_read, | ||
1058 | }; | ||
1039 | #endif | 1059 | #endif |
1040 | 1060 | ||
1041 | #ifdef CONFIG_FAULT_INJECTION | 1061 | #ifdef CONFIG_FAULT_INJECTION |
@@ -2269,6 +2289,9 @@ static const struct pid_entry tgid_base_stuff[] = { | |||
2269 | DIR("task", S_IRUGO|S_IXUGO, task), | 2289 | DIR("task", S_IRUGO|S_IXUGO, task), |
2270 | DIR("fd", S_IRUSR|S_IXUSR, fd), | 2290 | DIR("fd", S_IRUSR|S_IXUSR, fd), |
2271 | DIR("fdinfo", S_IRUSR|S_IXUSR, fdinfo), | 2291 | DIR("fdinfo", S_IRUSR|S_IXUSR, fdinfo), |
2292 | #ifdef CONFIG_NET | ||
2293 | DIR("net", S_IRUGO|S_IXUSR, net), | ||
2294 | #endif | ||
2272 | REG("environ", S_IRUSR, environ), | 2295 | REG("environ", S_IRUSR, environ), |
2273 | INF("auxv", S_IRUSR, pid_auxv), | 2296 | INF("auxv", S_IRUSR, pid_auxv), |
2274 | ONE("status", S_IRUGO, pid_status), | 2297 | ONE("status", S_IRUGO, pid_status), |
@@ -2316,6 +2339,7 @@ static const struct pid_entry tgid_base_stuff[] = { | |||
2316 | REG("oom_adj", S_IRUGO|S_IWUSR, oom_adjust), | 2339 | REG("oom_adj", S_IRUGO|S_IWUSR, oom_adjust), |
2317 | #ifdef CONFIG_AUDITSYSCALL | 2340 | #ifdef CONFIG_AUDITSYSCALL |
2318 | REG("loginuid", S_IWUSR|S_IRUGO, loginuid), | 2341 | REG("loginuid", S_IWUSR|S_IRUGO, loginuid), |
2342 | REG("sessionid", S_IRUSR, sessionid), | ||
2319 | #endif | 2343 | #endif |
2320 | #ifdef CONFIG_FAULT_INJECTION | 2344 | #ifdef CONFIG_FAULT_INJECTION |
2321 | REG("make-it-fail", S_IRUGO|S_IWUSR, fault_inject), | 2345 | REG("make-it-fail", S_IRUGO|S_IWUSR, fault_inject), |
@@ -2646,6 +2670,7 @@ static const struct pid_entry tid_base_stuff[] = { | |||
2646 | REG("oom_adj", S_IRUGO|S_IWUSR, oom_adjust), | 2670 | REG("oom_adj", S_IRUGO|S_IWUSR, oom_adjust), |
2647 | #ifdef CONFIG_AUDITSYSCALL | 2671 | #ifdef CONFIG_AUDITSYSCALL |
2648 | REG("loginuid", S_IWUSR|S_IRUGO, loginuid), | 2672 | REG("loginuid", S_IWUSR|S_IRUGO, loginuid), |
2673 | REG("sessionid", S_IRUSR, sessionid), | ||
2649 | #endif | 2674 | #endif |
2650 | #ifdef CONFIG_FAULT_INJECTION | 2675 | #ifdef CONFIG_FAULT_INJECTION |
2651 | REG("make-it-fail", S_IRUGO|S_IWUSR, fault_inject), | 2676 | REG("make-it-fail", S_IRUGO|S_IWUSR, fault_inject), |
diff --git a/fs/proc/generic.c b/fs/proc/generic.c index 68971e66cd41..a36ad3c75cf4 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c | |||
@@ -377,15 +377,14 @@ static struct dentry_operations proc_dentry_operations = | |||
377 | * Don't create negative dentries here, return -ENOENT by hand | 377 | * Don't create negative dentries here, return -ENOENT by hand |
378 | * instead. | 378 | * instead. |
379 | */ | 379 | */ |
380 | struct dentry *proc_lookup(struct inode * dir, struct dentry *dentry, struct nameidata *nd) | 380 | struct dentry *proc_lookup_de(struct proc_dir_entry *de, struct inode *dir, |
381 | struct dentry *dentry) | ||
381 | { | 382 | { |
382 | struct inode *inode = NULL; | 383 | struct inode *inode = NULL; |
383 | struct proc_dir_entry * de; | ||
384 | int error = -ENOENT; | 384 | int error = -ENOENT; |
385 | 385 | ||
386 | lock_kernel(); | 386 | lock_kernel(); |
387 | spin_lock(&proc_subdir_lock); | 387 | spin_lock(&proc_subdir_lock); |
388 | de = PDE(dir); | ||
389 | if (de) { | 388 | if (de) { |
390 | for (de = de->subdir; de ; de = de->next) { | 389 | for (de = de->subdir; de ; de = de->next) { |
391 | if (de->namelen != dentry->d_name.len) | 390 | if (de->namelen != dentry->d_name.len) |
@@ -393,8 +392,6 @@ struct dentry *proc_lookup(struct inode * dir, struct dentry *dentry, struct nam | |||
393 | if (!memcmp(dentry->d_name.name, de->name, de->namelen)) { | 392 | if (!memcmp(dentry->d_name.name, de->name, de->namelen)) { |
394 | unsigned int ino; | 393 | unsigned int ino; |
395 | 394 | ||
396 | if (de->shadow_proc) | ||
397 | de = de->shadow_proc(current, de); | ||
398 | ino = de->low_ino; | 395 | ino = de->low_ino; |
399 | de_get(de); | 396 | de_get(de); |
400 | spin_unlock(&proc_subdir_lock); | 397 | spin_unlock(&proc_subdir_lock); |
@@ -417,6 +414,12 @@ out_unlock: | |||
417 | return ERR_PTR(error); | 414 | return ERR_PTR(error); |
418 | } | 415 | } |
419 | 416 | ||
417 | struct dentry *proc_lookup(struct inode *dir, struct dentry *dentry, | ||
418 | struct nameidata *nd) | ||
419 | { | ||
420 | return proc_lookup_de(PDE(dir), dir, dentry); | ||
421 | } | ||
422 | |||
420 | /* | 423 | /* |
421 | * This returns non-zero if at EOF, so that the /proc | 424 | * This returns non-zero if at EOF, so that the /proc |
422 | * root directory can use this and check if it should | 425 | * root directory can use this and check if it should |
@@ -426,10 +429,9 @@ out_unlock: | |||
426 | * value of the readdir() call, as long as it's non-negative | 429 | * value of the readdir() call, as long as it's non-negative |
427 | * for success.. | 430 | * for success.. |
428 | */ | 431 | */ |
429 | int proc_readdir(struct file * filp, | 432 | int proc_readdir_de(struct proc_dir_entry *de, struct file *filp, void *dirent, |
430 | void * dirent, filldir_t filldir) | 433 | filldir_t filldir) |
431 | { | 434 | { |
432 | struct proc_dir_entry * de; | ||
433 | unsigned int ino; | 435 | unsigned int ino; |
434 | int i; | 436 | int i; |
435 | struct inode *inode = filp->f_path.dentry->d_inode; | 437 | struct inode *inode = filp->f_path.dentry->d_inode; |
@@ -438,7 +440,6 @@ int proc_readdir(struct file * filp, | |||
438 | lock_kernel(); | 440 | lock_kernel(); |
439 | 441 | ||
440 | ino = inode->i_ino; | 442 | ino = inode->i_ino; |
441 | de = PDE(inode); | ||
442 | if (!de) { | 443 | if (!de) { |
443 | ret = -EINVAL; | 444 | ret = -EINVAL; |
444 | goto out; | 445 | goto out; |
@@ -499,6 +500,13 @@ out: unlock_kernel(); | |||
499 | return ret; | 500 | return ret; |
500 | } | 501 | } |
501 | 502 | ||
503 | int proc_readdir(struct file *filp, void *dirent, filldir_t filldir) | ||
504 | { | ||
505 | struct inode *inode = filp->f_path.dentry->d_inode; | ||
506 | |||
507 | return proc_readdir_de(PDE(inode), filp, dirent, filldir); | ||
508 | } | ||
509 | |||
502 | /* | 510 | /* |
503 | * These are the generic /proc directory operations. They | 511 | * These are the generic /proc directory operations. They |
504 | * use the in-memory "struct proc_dir_entry" tree to parse | 512 | * use the in-memory "struct proc_dir_entry" tree to parse |
diff --git a/fs/proc/internal.h b/fs/proc/internal.h index 1c81c8f1aeed..bc72f5c8c47d 100644 --- a/fs/proc/internal.h +++ b/fs/proc/internal.h | |||
@@ -64,6 +64,8 @@ extern const struct file_operations proc_numa_maps_operations; | |||
64 | extern const struct file_operations proc_smaps_operations; | 64 | extern const struct file_operations proc_smaps_operations; |
65 | extern const struct file_operations proc_clear_refs_operations; | 65 | extern const struct file_operations proc_clear_refs_operations; |
66 | extern const struct file_operations proc_pagemap_operations; | 66 | extern const struct file_operations proc_pagemap_operations; |
67 | extern const struct file_operations proc_net_operations; | ||
68 | extern const struct inode_operations proc_net_inode_operations; | ||
67 | 69 | ||
68 | void free_proc_entry(struct proc_dir_entry *de); | 70 | void free_proc_entry(struct proc_dir_entry *de); |
69 | 71 | ||
@@ -83,3 +85,8 @@ static inline int proc_fd(struct inode *inode) | |||
83 | { | 85 | { |
84 | return PROC_I(inode)->fd; | 86 | return PROC_I(inode)->fd; |
85 | } | 87 | } |
88 | |||
89 | struct dentry *proc_lookup_de(struct proc_dir_entry *de, struct inode *ino, | ||
90 | struct dentry *dentry); | ||
91 | int proc_readdir_de(struct proc_dir_entry *de, struct file *filp, void *dirent, | ||
92 | filldir_t filldir); | ||
diff --git a/fs/proc/proc_net.c b/fs/proc/proc_net.c index 14e9b5aaf863..4caa5f774fb7 100644 --- a/fs/proc/proc_net.c +++ b/fs/proc/proc_net.c | |||
@@ -63,6 +63,82 @@ int seq_release_net(struct inode *ino, struct file *f) | |||
63 | } | 63 | } |
64 | EXPORT_SYMBOL_GPL(seq_release_net); | 64 | EXPORT_SYMBOL_GPL(seq_release_net); |
65 | 65 | ||
66 | static struct net *get_proc_task_net(struct inode *dir) | ||
67 | { | ||
68 | struct task_struct *task; | ||
69 | struct nsproxy *ns; | ||
70 | struct net *net = NULL; | ||
71 | |||
72 | rcu_read_lock(); | ||
73 | task = pid_task(proc_pid(dir), PIDTYPE_PID); | ||
74 | if (task != NULL) { | ||
75 | ns = task_nsproxy(task); | ||
76 | if (ns != NULL) | ||
77 | net = get_net(ns->net_ns); | ||
78 | } | ||
79 | rcu_read_unlock(); | ||
80 | |||
81 | return net; | ||
82 | } | ||
83 | |||
84 | static struct dentry *proc_tgid_net_lookup(struct inode *dir, | ||
85 | struct dentry *dentry, struct nameidata *nd) | ||
86 | { | ||
87 | struct dentry *de; | ||
88 | struct net *net; | ||
89 | |||
90 | de = ERR_PTR(-ENOENT); | ||
91 | net = get_proc_task_net(dir); | ||
92 | if (net != NULL) { | ||
93 | de = proc_lookup_de(net->proc_net, dir, dentry); | ||
94 | put_net(net); | ||
95 | } | ||
96 | return de; | ||
97 | } | ||
98 | |||
99 | static int proc_tgid_net_getattr(struct vfsmount *mnt, struct dentry *dentry, | ||
100 | struct kstat *stat) | ||
101 | { | ||
102 | struct inode *inode = dentry->d_inode; | ||
103 | struct net *net; | ||
104 | |||
105 | net = get_proc_task_net(inode); | ||
106 | |||
107 | generic_fillattr(inode, stat); | ||
108 | |||
109 | if (net != NULL) { | ||
110 | stat->nlink = net->proc_net->nlink; | ||
111 | put_net(net); | ||
112 | } | ||
113 | |||
114 | return 0; | ||
115 | } | ||
116 | |||
117 | const struct inode_operations proc_net_inode_operations = { | ||
118 | .lookup = proc_tgid_net_lookup, | ||
119 | .getattr = proc_tgid_net_getattr, | ||
120 | }; | ||
121 | |||
122 | static int proc_tgid_net_readdir(struct file *filp, void *dirent, | ||
123 | filldir_t filldir) | ||
124 | { | ||
125 | int ret; | ||
126 | struct net *net; | ||
127 | |||
128 | ret = -EINVAL; | ||
129 | net = get_proc_task_net(filp->f_path.dentry->d_inode); | ||
130 | if (net != NULL) { | ||
131 | ret = proc_readdir_de(net->proc_net, filp, dirent, filldir); | ||
132 | put_net(net); | ||
133 | } | ||
134 | return ret; | ||
135 | } | ||
136 | |||
137 | const struct file_operations proc_net_operations = { | ||
138 | .read = generic_read_dir, | ||
139 | .readdir = proc_tgid_net_readdir, | ||
140 | }; | ||
141 | |||
66 | 142 | ||
67 | struct proc_dir_entry *proc_net_fops_create(struct net *net, | 143 | struct proc_dir_entry *proc_net_fops_create(struct net *net, |
68 | const char *name, mode_t mode, const struct file_operations *fops) | 144 | const char *name, mode_t mode, const struct file_operations *fops) |
@@ -83,14 +159,6 @@ struct net *get_proc_net(const struct inode *inode) | |||
83 | } | 159 | } |
84 | EXPORT_SYMBOL_GPL(get_proc_net); | 160 | EXPORT_SYMBOL_GPL(get_proc_net); |
85 | 161 | ||
86 | static struct proc_dir_entry *shadow_pde; | ||
87 | |||
88 | static struct proc_dir_entry *proc_net_shadow(struct task_struct *task, | ||
89 | struct proc_dir_entry *de) | ||
90 | { | ||
91 | return task->nsproxy->net_ns->proc_net; | ||
92 | } | ||
93 | |||
94 | struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name, | 162 | struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name, |
95 | struct proc_dir_entry *parent) | 163 | struct proc_dir_entry *parent) |
96 | { | 164 | { |
@@ -104,45 +172,39 @@ EXPORT_SYMBOL_GPL(proc_net_mkdir); | |||
104 | 172 | ||
105 | static __net_init int proc_net_ns_init(struct net *net) | 173 | static __net_init int proc_net_ns_init(struct net *net) |
106 | { | 174 | { |
107 | struct proc_dir_entry *root, *netd, *net_statd; | 175 | struct proc_dir_entry *netd, *net_statd; |
108 | int err; | 176 | int err; |
109 | 177 | ||
110 | err = -ENOMEM; | 178 | err = -ENOMEM; |
111 | root = kzalloc(sizeof(*root), GFP_KERNEL); | 179 | netd = kzalloc(sizeof(*netd), GFP_KERNEL); |
112 | if (!root) | 180 | if (!netd) |
113 | goto out; | 181 | goto out; |
114 | 182 | ||
115 | err = -EEXIST; | 183 | netd->data = net; |
116 | netd = proc_net_mkdir(net, "net", root); | 184 | netd->nlink = 2; |
117 | if (!netd) | 185 | netd->name = "net"; |
118 | goto free_root; | 186 | netd->namelen = 3; |
187 | netd->parent = &proc_root; | ||
119 | 188 | ||
120 | err = -EEXIST; | 189 | err = -EEXIST; |
121 | net_statd = proc_net_mkdir(net, "stat", netd); | 190 | net_statd = proc_net_mkdir(net, "stat", netd); |
122 | if (!net_statd) | 191 | if (!net_statd) |
123 | goto free_net; | 192 | goto free_net; |
124 | 193 | ||
125 | root->data = net; | ||
126 | |||
127 | net->proc_net_root = root; | ||
128 | net->proc_net = netd; | 194 | net->proc_net = netd; |
129 | net->proc_net_stat = net_statd; | 195 | net->proc_net_stat = net_statd; |
130 | err = 0; | 196 | return 0; |
131 | 197 | ||
198 | free_net: | ||
199 | kfree(netd); | ||
132 | out: | 200 | out: |
133 | return err; | 201 | return err; |
134 | free_net: | ||
135 | remove_proc_entry("net", root); | ||
136 | free_root: | ||
137 | kfree(root); | ||
138 | goto out; | ||
139 | } | 202 | } |
140 | 203 | ||
141 | static __net_exit void proc_net_ns_exit(struct net *net) | 204 | static __net_exit void proc_net_ns_exit(struct net *net) |
142 | { | 205 | { |
143 | remove_proc_entry("stat", net->proc_net); | 206 | remove_proc_entry("stat", net->proc_net); |
144 | remove_proc_entry("net", net->proc_net_root); | 207 | kfree(net->proc_net); |
145 | kfree(net->proc_net_root); | ||
146 | } | 208 | } |
147 | 209 | ||
148 | static struct pernet_operations __net_initdata proc_net_ns_ops = { | 210 | static struct pernet_operations __net_initdata proc_net_ns_ops = { |
@@ -152,8 +214,7 @@ static struct pernet_operations __net_initdata proc_net_ns_ops = { | |||
152 | 214 | ||
153 | int __init proc_net_init(void) | 215 | int __init proc_net_init(void) |
154 | { | 216 | { |
155 | shadow_pde = proc_mkdir("net", NULL); | 217 | proc_symlink("net", NULL, "self/net"); |
156 | shadow_pde->shadow_proc = proc_net_shadow; | ||
157 | 218 | ||
158 | return register_pernet_subsys(&proc_net_ns_ops); | 219 | return register_pernet_subsys(&proc_net_ns_ops); |
159 | } | 220 | } |
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 6dc0334815f7..4206454734e0 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c | |||
@@ -640,17 +640,17 @@ static ssize_t pagemap_read(struct file *file, char __user *buf, | |||
640 | 640 | ||
641 | ret = -EACCES; | 641 | ret = -EACCES; |
642 | if (!ptrace_may_attach(task)) | 642 | if (!ptrace_may_attach(task)) |
643 | goto out; | 643 | goto out_task; |
644 | 644 | ||
645 | ret = -EINVAL; | 645 | ret = -EINVAL; |
646 | /* file position must be aligned */ | 646 | /* file position must be aligned */ |
647 | if (*ppos % PM_ENTRY_BYTES) | 647 | if (*ppos % PM_ENTRY_BYTES) |
648 | goto out; | 648 | goto out_task; |
649 | 649 | ||
650 | ret = 0; | 650 | ret = 0; |
651 | mm = get_task_mm(task); | 651 | mm = get_task_mm(task); |
652 | if (!mm) | 652 | if (!mm) |
653 | goto out; | 653 | goto out_task; |
654 | 654 | ||
655 | ret = -ENOMEM; | 655 | ret = -ENOMEM; |
656 | uaddr = (unsigned long)buf & PAGE_MASK; | 656 | uaddr = (unsigned long)buf & PAGE_MASK; |
@@ -658,7 +658,7 @@ static ssize_t pagemap_read(struct file *file, char __user *buf, | |||
658 | pagecount = (PAGE_ALIGN(uend) - uaddr) / PAGE_SIZE; | 658 | pagecount = (PAGE_ALIGN(uend) - uaddr) / PAGE_SIZE; |
659 | pages = kmalloc(pagecount * sizeof(struct page *), GFP_KERNEL); | 659 | pages = kmalloc(pagecount * sizeof(struct page *), GFP_KERNEL); |
660 | if (!pages) | 660 | if (!pages) |
661 | goto out_task; | 661 | goto out_mm; |
662 | 662 | ||
663 | down_read(¤t->mm->mmap_sem); | 663 | down_read(¤t->mm->mmap_sem); |
664 | ret = get_user_pages(current, current->mm, uaddr, pagecount, | 664 | ret = get_user_pages(current, current->mm, uaddr, pagecount, |
@@ -668,6 +668,12 @@ static ssize_t pagemap_read(struct file *file, char __user *buf, | |||
668 | if (ret < 0) | 668 | if (ret < 0) |
669 | goto out_free; | 669 | goto out_free; |
670 | 670 | ||
671 | if (ret != pagecount) { | ||
672 | pagecount = ret; | ||
673 | ret = -EFAULT; | ||
674 | goto out_pages; | ||
675 | } | ||
676 | |||
671 | pm.out = buf; | 677 | pm.out = buf; |
672 | pm.end = buf + count; | 678 | pm.end = buf + count; |
673 | 679 | ||
@@ -699,15 +705,17 @@ static ssize_t pagemap_read(struct file *file, char __user *buf, | |||
699 | ret = pm.out - buf; | 705 | ret = pm.out - buf; |
700 | } | 706 | } |
701 | 707 | ||
708 | out_pages: | ||
702 | for (; pagecount; pagecount--) { | 709 | for (; pagecount; pagecount--) { |
703 | page = pages[pagecount-1]; | 710 | page = pages[pagecount-1]; |
704 | if (!PageReserved(page)) | 711 | if (!PageReserved(page)) |
705 | SetPageDirty(page); | 712 | SetPageDirty(page); |
706 | page_cache_release(page); | 713 | page_cache_release(page); |
707 | } | 714 | } |
708 | mmput(mm); | ||
709 | out_free: | 715 | out_free: |
710 | kfree(pages); | 716 | kfree(pages); |
717 | out_mm: | ||
718 | mmput(mm); | ||
711 | out_task: | 719 | out_task: |
712 | put_task_struct(task); | 720 | put_task_struct(task); |
713 | out: | 721 | out: |
diff --git a/fs/romfs/inode.c b/fs/romfs/inode.c index 00b6f0a518c8..3f13d491c7c7 100644 --- a/fs/romfs/inode.c +++ b/fs/romfs/inode.c | |||
@@ -340,8 +340,9 @@ static struct dentry * | |||
340 | romfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd) | 340 | romfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd) |
341 | { | 341 | { |
342 | unsigned long offset, maxoff; | 342 | unsigned long offset, maxoff; |
343 | int fslen, res; | 343 | long res; |
344 | struct inode *inode; | 344 | int fslen; |
345 | struct inode *inode = NULL; | ||
345 | char fsname[ROMFS_MAXFN]; /* XXX dynamic? */ | 346 | char fsname[ROMFS_MAXFN]; /* XXX dynamic? */ |
346 | struct romfs_inode ri; | 347 | struct romfs_inode ri; |
347 | const char *name; /* got from dentry */ | 348 | const char *name; /* got from dentry */ |
@@ -351,7 +352,7 @@ romfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd) | |||
351 | offset = dir->i_ino & ROMFH_MASK; | 352 | offset = dir->i_ino & ROMFH_MASK; |
352 | lock_kernel(); | 353 | lock_kernel(); |
353 | if (romfs_copyfrom(dir, &ri, offset, ROMFH_SIZE) <= 0) | 354 | if (romfs_copyfrom(dir, &ri, offset, ROMFH_SIZE) <= 0) |
354 | goto out; | 355 | goto error; |
355 | 356 | ||
356 | maxoff = romfs_maxsize(dir->i_sb); | 357 | maxoff = romfs_maxsize(dir->i_sb); |
357 | offset = be32_to_cpu(ri.spec) & ROMFH_MASK; | 358 | offset = be32_to_cpu(ri.spec) & ROMFH_MASK; |
@@ -364,9 +365,9 @@ romfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd) | |||
364 | 365 | ||
365 | for(;;) { | 366 | for(;;) { |
366 | if (!offset || offset >= maxoff) | 367 | if (!offset || offset >= maxoff) |
367 | goto out0; | 368 | goto success; /* negative success */ |
368 | if (romfs_copyfrom(dir, &ri, offset, ROMFH_SIZE) <= 0) | 369 | if (romfs_copyfrom(dir, &ri, offset, ROMFH_SIZE) <= 0) |
369 | goto out; | 370 | goto error; |
370 | 371 | ||
371 | /* try to match the first 16 bytes of name */ | 372 | /* try to match the first 16 bytes of name */ |
372 | fslen = romfs_strnlen(dir, offset+ROMFH_SIZE, ROMFH_SIZE); | 373 | fslen = romfs_strnlen(dir, offset+ROMFH_SIZE, ROMFH_SIZE); |
@@ -397,23 +398,14 @@ romfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd) | |||
397 | inode = romfs_iget(dir->i_sb, offset); | 398 | inode = romfs_iget(dir->i_sb, offset); |
398 | if (IS_ERR(inode)) { | 399 | if (IS_ERR(inode)) { |
399 | res = PTR_ERR(inode); | 400 | res = PTR_ERR(inode); |
400 | goto out; | 401 | goto error; |
401 | } | 402 | } |
402 | 403 | ||
403 | /* | 404 | success: |
404 | * it's a bit funky, _lookup needs to return an error code | 405 | d_add(dentry, inode); |
405 | * (negative) or a NULL, both as a dentry. ENOENT should not | ||
406 | * be returned, instead we need to create a negative dentry by | ||
407 | * d_add(dentry, NULL); and return 0 as no error. | ||
408 | * (Although as I see, it only matters on writable file | ||
409 | * systems). | ||
410 | */ | ||
411 | |||
412 | out0: inode = NULL; | ||
413 | res = 0; | 406 | res = 0; |
414 | d_add (dentry, inode); | 407 | error: |
415 | 408 | unlock_kernel(); | |
416 | out: unlock_kernel(); | ||
417 | return ERR_PTR(res); | 409 | return ERR_PTR(res); |
418 | } | 410 | } |
419 | 411 | ||
diff --git a/fs/super.c b/fs/super.c index 010446d8c40a..d0a941a4e620 100644 --- a/fs/super.c +++ b/fs/super.c | |||
@@ -556,11 +556,11 @@ out: | |||
556 | } | 556 | } |
557 | 557 | ||
558 | /** | 558 | /** |
559 | * mark_files_ro | 559 | * mark_files_ro - mark all files read-only |
560 | * @sb: superblock in question | 560 | * @sb: superblock in question |
561 | * | 561 | * |
562 | * All files are marked read/only. We don't care about pending | 562 | * All files are marked read-only. We don't care about pending |
563 | * delete files so this should be used in 'force' mode only | 563 | * delete files so this should be used in 'force' mode only. |
564 | */ | 564 | */ |
565 | 565 | ||
566 | static void mark_files_ro(struct super_block *sb) | 566 | static void mark_files_ro(struct super_block *sb) |
diff --git a/fs/ufs/balloc.c b/fs/ufs/balloc.c index 1fca381f0ce2..1e7598fb9787 100644 --- a/fs/ufs/balloc.c +++ b/fs/ufs/balloc.c | |||
@@ -315,8 +315,8 @@ static void ufs_change_blocknr(struct inode *inode, sector_t beg, | |||
315 | } | 315 | } |
316 | 316 | ||
317 | UFSD(" change from %llu to %llu, pos %u\n", | 317 | UFSD(" change from %llu to %llu, pos %u\n", |
318 | (unsigned long long)pos + oldb, | 318 | (unsigned long long)(pos + oldb), |
319 | (unsigned long long)pos + newb, pos); | 319 | (unsigned long long)(pos + newb), pos); |
320 | 320 | ||
321 | bh->b_blocknr = newb + pos; | 321 | bh->b_blocknr = newb + pos; |
322 | unmap_underlying_metadata(bh->b_bdev, | 322 | unmap_underlying_metadata(bh->b_bdev, |