diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext2/balloc.c | 1 | ||||
-rw-r--r-- | fs/ext2/ialloc.c | 1 | ||||
-rw-r--r-- | fs/ext2/super.c | 41 | ||||
-rw-r--r-- | fs/ext3/inode.c | 2 | ||||
-rw-r--r-- | fs/ext3/super.c | 42 | ||||
-rw-r--r-- | fs/jffs2/nodelist.c | 6 | ||||
-rw-r--r-- | fs/jffs2/nodelist.h | 1 | ||||
-rw-r--r-- | fs/jffs2/summary.c | 5 | ||||
-rw-r--r-- | fs/jffs2/xattr.c | 1 | ||||
-rw-r--r-- | fs/nfs/nfs4proc.c | 6 | ||||
-rw-r--r-- | fs/nfs/read.c | 6 | ||||
-rw-r--r-- | fs/nfs/write.c | 4 |
12 files changed, 101 insertions, 15 deletions
diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c index d4870432ecfc..b1981d0e95ad 100644 --- a/fs/ext2/balloc.c +++ b/fs/ext2/balloc.c | |||
@@ -539,7 +539,6 @@ unsigned long ext2_count_free (struct buffer_head * map, unsigned int numchars) | |||
539 | 539 | ||
540 | #endif /* EXT2FS_DEBUG */ | 540 | #endif /* EXT2FS_DEBUG */ |
541 | 541 | ||
542 | /* Superblock must be locked */ | ||
543 | unsigned long ext2_count_free_blocks (struct super_block * sb) | 542 | unsigned long ext2_count_free_blocks (struct super_block * sb) |
544 | { | 543 | { |
545 | struct ext2_group_desc * desc; | 544 | struct ext2_group_desc * desc; |
diff --git a/fs/ext2/ialloc.c b/fs/ext2/ialloc.c index de85c61c58c5..695f69ccf908 100644 --- a/fs/ext2/ialloc.c +++ b/fs/ext2/ialloc.c | |||
@@ -637,7 +637,6 @@ fail: | |||
637 | return ERR_PTR(err); | 637 | return ERR_PTR(err); |
638 | } | 638 | } |
639 | 639 | ||
640 | /* Superblock must be locked */ | ||
641 | unsigned long ext2_count_free_inodes (struct super_block * sb) | 640 | unsigned long ext2_count_free_inodes (struct super_block * sb) |
642 | { | 641 | { |
643 | struct ext2_group_desc *desc; | 642 | struct ext2_group_desc *desc; |
diff --git a/fs/ext2/super.c b/fs/ext2/super.c index 681dea8f9532..4286ff6330b6 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c | |||
@@ -251,6 +251,44 @@ static struct super_operations ext2_sops = { | |||
251 | #endif | 251 | #endif |
252 | }; | 252 | }; |
253 | 253 | ||
254 | static struct dentry *ext2_get_dentry(struct super_block *sb, void *vobjp) | ||
255 | { | ||
256 | __u32 *objp = vobjp; | ||
257 | unsigned long ino = objp[0]; | ||
258 | __u32 generation = objp[1]; | ||
259 | struct inode *inode; | ||
260 | struct dentry *result; | ||
261 | |||
262 | if (ino < EXT2_FIRST_INO(sb) && ino != EXT2_ROOT_INO) | ||
263 | return ERR_PTR(-ESTALE); | ||
264 | if (ino > le32_to_cpu(EXT2_SB(sb)->s_es->s_inodes_count)) | ||
265 | return ERR_PTR(-ESTALE); | ||
266 | |||
267 | /* iget isn't really right if the inode is currently unallocated!! | ||
268 | * ext2_read_inode currently does appropriate checks, but | ||
269 | * it might be "neater" to call ext2_get_inode first and check | ||
270 | * if the inode is valid..... | ||
271 | */ | ||
272 | inode = iget(sb, ino); | ||
273 | if (inode == NULL) | ||
274 | return ERR_PTR(-ENOMEM); | ||
275 | if (is_bad_inode(inode) || | ||
276 | (generation && inode->i_generation != generation)) { | ||
277 | /* we didn't find the right inode.. */ | ||
278 | iput(inode); | ||
279 | return ERR_PTR(-ESTALE); | ||
280 | } | ||
281 | /* now to find a dentry. | ||
282 | * If possible, get a well-connected one | ||
283 | */ | ||
284 | result = d_alloc_anon(inode); | ||
285 | if (!result) { | ||
286 | iput(inode); | ||
287 | return ERR_PTR(-ENOMEM); | ||
288 | } | ||
289 | return result; | ||
290 | } | ||
291 | |||
254 | /* Yes, most of these are left as NULL!! | 292 | /* Yes, most of these are left as NULL!! |
255 | * A NULL value implies the default, which works with ext2-like file | 293 | * A NULL value implies the default, which works with ext2-like file |
256 | * systems, but can be improved upon. | 294 | * systems, but can be improved upon. |
@@ -258,6 +296,7 @@ static struct super_operations ext2_sops = { | |||
258 | */ | 296 | */ |
259 | static struct export_operations ext2_export_ops = { | 297 | static struct export_operations ext2_export_ops = { |
260 | .get_parent = ext2_get_parent, | 298 | .get_parent = ext2_get_parent, |
299 | .get_dentry = ext2_get_dentry, | ||
261 | }; | 300 | }; |
262 | 301 | ||
263 | static unsigned long get_sb_block(void **data) | 302 | static unsigned long get_sb_block(void **data) |
@@ -1044,7 +1083,6 @@ static int ext2_statfs (struct dentry * dentry, struct kstatfs * buf) | |||
1044 | unsigned long overhead; | 1083 | unsigned long overhead; |
1045 | int i; | 1084 | int i; |
1046 | 1085 | ||
1047 | lock_super(sb); | ||
1048 | if (test_opt (sb, MINIX_DF)) | 1086 | if (test_opt (sb, MINIX_DF)) |
1049 | overhead = 0; | 1087 | overhead = 0; |
1050 | else { | 1088 | else { |
@@ -1085,7 +1123,6 @@ static int ext2_statfs (struct dentry * dentry, struct kstatfs * buf) | |||
1085 | buf->f_files = le32_to_cpu(sbi->s_es->s_inodes_count); | 1123 | buf->f_files = le32_to_cpu(sbi->s_es->s_inodes_count); |
1086 | buf->f_ffree = ext2_count_free_inodes (sb); | 1124 | buf->f_ffree = ext2_count_free_inodes (sb); |
1087 | buf->f_namelen = EXT2_NAME_LEN; | 1125 | buf->f_namelen = EXT2_NAME_LEN; |
1088 | unlock_super(sb); | ||
1089 | return 0; | 1126 | return 0; |
1090 | } | 1127 | } |
1091 | 1128 | ||
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c index 0f0b1eadb98d..84be02e93652 100644 --- a/fs/ext3/inode.c +++ b/fs/ext3/inode.c | |||
@@ -925,7 +925,7 @@ int ext3_get_blocks_handle(handle_t *handle, struct inode *inode, | |||
925 | set_buffer_new(bh_result); | 925 | set_buffer_new(bh_result); |
926 | got_it: | 926 | got_it: |
927 | map_bh(bh_result, inode->i_sb, le32_to_cpu(chain[depth-1].key)); | 927 | map_bh(bh_result, inode->i_sb, le32_to_cpu(chain[depth-1].key)); |
928 | if (blocks_to_boundary == 0) | 928 | if (count > blocks_to_boundary) |
929 | set_buffer_boundary(bh_result); | 929 | set_buffer_boundary(bh_result); |
930 | err = count; | 930 | err = count; |
931 | /* Clean up and exit */ | 931 | /* Clean up and exit */ |
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 813d589cc6c0..3559086eee5f 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c | |||
@@ -554,6 +554,47 @@ static int ext3_show_options(struct seq_file *seq, struct vfsmount *vfs) | |||
554 | return 0; | 554 | return 0; |
555 | } | 555 | } |
556 | 556 | ||
557 | |||
558 | static struct dentry *ext3_get_dentry(struct super_block *sb, void *vobjp) | ||
559 | { | ||
560 | __u32 *objp = vobjp; | ||
561 | unsigned long ino = objp[0]; | ||
562 | __u32 generation = objp[1]; | ||
563 | struct inode *inode; | ||
564 | struct dentry *result; | ||
565 | |||
566 | if (ino < EXT3_FIRST_INO(sb) && ino != EXT3_ROOT_INO) | ||
567 | return ERR_PTR(-ESTALE); | ||
568 | if (ino > le32_to_cpu(EXT3_SB(sb)->s_es->s_inodes_count)) | ||
569 | return ERR_PTR(-ESTALE); | ||
570 | |||
571 | /* iget isn't really right if the inode is currently unallocated!! | ||
572 | * | ||
573 | * ext3_read_inode will return a bad_inode if the inode had been | ||
574 | * deleted, so we should be safe. | ||
575 | * | ||
576 | * Currently we don't know the generation for parent directory, so | ||
577 | * a generation of 0 means "accept any" | ||
578 | */ | ||
579 | inode = iget(sb, ino); | ||
580 | if (inode == NULL) | ||
581 | return ERR_PTR(-ENOMEM); | ||
582 | if (is_bad_inode(inode) || | ||
583 | (generation && inode->i_generation != generation)) { | ||
584 | iput(inode); | ||
585 | return ERR_PTR(-ESTALE); | ||
586 | } | ||
587 | /* now to find a dentry. | ||
588 | * If possible, get a well-connected one | ||
589 | */ | ||
590 | result = d_alloc_anon(inode); | ||
591 | if (!result) { | ||
592 | iput(inode); | ||
593 | return ERR_PTR(-ENOMEM); | ||
594 | } | ||
595 | return result; | ||
596 | } | ||
597 | |||
557 | #ifdef CONFIG_QUOTA | 598 | #ifdef CONFIG_QUOTA |
558 | #define QTYPE2NAME(t) ((t)==USRQUOTA?"user":"group") | 599 | #define QTYPE2NAME(t) ((t)==USRQUOTA?"user":"group") |
559 | #define QTYPE2MOPT(on, t) ((t)==USRQUOTA?((on)##USRJQUOTA):((on)##GRPJQUOTA)) | 600 | #define QTYPE2MOPT(on, t) ((t)==USRQUOTA?((on)##USRJQUOTA):((on)##GRPJQUOTA)) |
@@ -622,6 +663,7 @@ static struct super_operations ext3_sops = { | |||
622 | 663 | ||
623 | static struct export_operations ext3_export_ops = { | 664 | static struct export_operations ext3_export_ops = { |
624 | .get_parent = ext3_get_parent, | 665 | .get_parent = ext3_get_parent, |
666 | .get_dentry = ext3_get_dentry, | ||
625 | }; | 667 | }; |
626 | 668 | ||
627 | enum { | 669 | enum { |
diff --git a/fs/jffs2/nodelist.c b/fs/jffs2/nodelist.c index 7675b33396c7..5a6b4d64206c 100644 --- a/fs/jffs2/nodelist.c +++ b/fs/jffs2/nodelist.c | |||
@@ -21,6 +21,9 @@ | |||
21 | #include <linux/pagemap.h> | 21 | #include <linux/pagemap.h> |
22 | #include "nodelist.h" | 22 | #include "nodelist.h" |
23 | 23 | ||
24 | static void jffs2_obsolete_node_frag(struct jffs2_sb_info *c, | ||
25 | struct jffs2_node_frag *this); | ||
26 | |||
24 | void jffs2_add_fd_to_list(struct jffs2_sb_info *c, struct jffs2_full_dirent *new, struct jffs2_full_dirent **list) | 27 | void jffs2_add_fd_to_list(struct jffs2_sb_info *c, struct jffs2_full_dirent *new, struct jffs2_full_dirent **list) |
25 | { | 28 | { |
26 | struct jffs2_full_dirent **prev = list; | 29 | struct jffs2_full_dirent **prev = list; |
@@ -87,7 +90,8 @@ void jffs2_truncate_fragtree(struct jffs2_sb_info *c, struct rb_root *list, uint | |||
87 | } | 90 | } |
88 | } | 91 | } |
89 | 92 | ||
90 | void jffs2_obsolete_node_frag(struct jffs2_sb_info *c, struct jffs2_node_frag *this) | 93 | static void jffs2_obsolete_node_frag(struct jffs2_sb_info *c, |
94 | struct jffs2_node_frag *this) | ||
91 | { | 95 | { |
92 | if (this->node) { | 96 | if (this->node) { |
93 | this->node->frags--; | 97 | this->node->frags--; |
diff --git a/fs/jffs2/nodelist.h b/fs/jffs2/nodelist.h index cae92c14116d..0ddfd70307fb 100644 --- a/fs/jffs2/nodelist.h +++ b/fs/jffs2/nodelist.h | |||
@@ -334,7 +334,6 @@ void jffs2_kill_fragtree(struct rb_root *root, struct jffs2_sb_info *c_delete); | |||
334 | struct rb_node *rb_next(struct rb_node *); | 334 | struct rb_node *rb_next(struct rb_node *); |
335 | struct rb_node *rb_prev(struct rb_node *); | 335 | struct rb_node *rb_prev(struct rb_node *); |
336 | void rb_replace_node(struct rb_node *victim, struct rb_node *new, struct rb_root *root); | 336 | void rb_replace_node(struct rb_node *victim, struct rb_node *new, struct rb_root *root); |
337 | void jffs2_obsolete_node_frag(struct jffs2_sb_info *c, struct jffs2_node_frag *this); | ||
338 | int jffs2_add_full_dnode_to_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_full_dnode *fn); | 337 | int jffs2_add_full_dnode_to_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_full_dnode *fn); |
339 | void jffs2_truncate_fragtree (struct jffs2_sb_info *c, struct rb_root *list, uint32_t size); | 338 | void jffs2_truncate_fragtree (struct jffs2_sb_info *c, struct rb_root *list, uint32_t size); |
340 | int jffs2_add_older_frag_to_fragtree(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_tmp_dnode_info *tn); | 339 | int jffs2_add_older_frag_to_fragtree(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_tmp_dnode_info *tn); |
diff --git a/fs/jffs2/summary.c b/fs/jffs2/summary.c index c19bd476e8ec..e52cef526d90 100644 --- a/fs/jffs2/summary.c +++ b/fs/jffs2/summary.c | |||
@@ -252,6 +252,11 @@ int jffs2_sum_add_kvec(struct jffs2_sb_info *c, const struct kvec *invecs, | |||
252 | union jffs2_node_union *node; | 252 | union jffs2_node_union *node; |
253 | struct jffs2_eraseblock *jeb; | 253 | struct jffs2_eraseblock *jeb; |
254 | 254 | ||
255 | if (c->summary->sum_size == JFFS2_SUMMARY_NOSUM_SIZE) { | ||
256 | dbg_summary("Summary is disabled for this jeb! Skipping summary info!\n"); | ||
257 | return 0; | ||
258 | } | ||
259 | |||
255 | node = invecs[0].iov_base; | 260 | node = invecs[0].iov_base; |
256 | jeb = &c->blocks[ofs / c->sector_size]; | 261 | jeb = &c->blocks[ofs / c->sector_size]; |
257 | ofs -= jeb->offset; | 262 | ofs -= jeb->offset; |
diff --git a/fs/jffs2/xattr.c b/fs/jffs2/xattr.c index 25bc1ae08648..4da09ce1d1f5 100644 --- a/fs/jffs2/xattr.c +++ b/fs/jffs2/xattr.c | |||
@@ -1215,7 +1215,6 @@ int jffs2_garbage_collect_xattr_datum(struct jffs2_sb_info *c, struct jffs2_xatt | |||
1215 | rc = jffs2_reserve_space_gc(c, totlen, &length, JFFS2_SUMMARY_XATTR_SIZE); | 1215 | rc = jffs2_reserve_space_gc(c, totlen, &length, JFFS2_SUMMARY_XATTR_SIZE); |
1216 | if (rc) { | 1216 | if (rc) { |
1217 | JFFS2_WARNING("jffs2_reserve_space_gc()=%d, request=%u\n", rc, totlen); | 1217 | JFFS2_WARNING("jffs2_reserve_space_gc()=%d, request=%u\n", rc, totlen); |
1218 | rc = rc ? rc : -EBADFD; | ||
1219 | goto out; | 1218 | goto out; |
1220 | } | 1219 | } |
1221 | rc = save_xattr_datum(c, xd); | 1220 | rc = save_xattr_datum(c, xd); |
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 153898e1331f..b14145b7b87f 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -970,7 +970,7 @@ static int _nfs4_do_open(struct inode *dir, struct dentry *dentry, int flags, st | |||
970 | status = -ENOMEM; | 970 | status = -ENOMEM; |
971 | opendata = nfs4_opendata_alloc(dentry, sp, flags, sattr); | 971 | opendata = nfs4_opendata_alloc(dentry, sp, flags, sattr); |
972 | if (opendata == NULL) | 972 | if (opendata == NULL) |
973 | goto err_put_state_owner; | 973 | goto err_release_rwsem; |
974 | 974 | ||
975 | status = _nfs4_proc_open(opendata); | 975 | status = _nfs4_proc_open(opendata); |
976 | if (status != 0) | 976 | if (status != 0) |
@@ -989,11 +989,11 @@ static int _nfs4_do_open(struct inode *dir, struct dentry *dentry, int flags, st | |||
989 | return 0; | 989 | return 0; |
990 | err_opendata_free: | 990 | err_opendata_free: |
991 | nfs4_opendata_free(opendata); | 991 | nfs4_opendata_free(opendata); |
992 | err_release_rwsem: | ||
993 | up_read(&clp->cl_sem); | ||
992 | err_put_state_owner: | 994 | err_put_state_owner: |
993 | nfs4_put_state_owner(sp); | 995 | nfs4_put_state_owner(sp); |
994 | out_err: | 996 | out_err: |
995 | /* Note: clp->cl_sem must be released before nfs4_put_open_state()! */ | ||
996 | up_read(&clp->cl_sem); | ||
997 | *res = NULL; | 997 | *res = NULL; |
998 | return status; | 998 | return status; |
999 | } | 999 | } |
diff --git a/fs/nfs/read.c b/fs/nfs/read.c index 7a9ee00e0c61..f0aff824a291 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c | |||
@@ -204,9 +204,11 @@ static int nfs_readpage_sync(struct nfs_open_context *ctx, struct inode *inode, | |||
204 | NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATIME; | 204 | NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATIME; |
205 | spin_unlock(&inode->i_lock); | 205 | spin_unlock(&inode->i_lock); |
206 | 206 | ||
207 | nfs_readpage_truncate_uninitialised_page(rdata); | 207 | if (rdata->res.eof || rdata->res.count == rdata->args.count) { |
208 | if (rdata->res.eof || rdata->res.count == rdata->args.count) | ||
209 | SetPageUptodate(page); | 208 | SetPageUptodate(page); |
209 | if (rdata->res.eof && count != 0) | ||
210 | memclear_highpage_flush(page, rdata->args.pgbase, count); | ||
211 | } | ||
210 | result = 0; | 212 | result = 0; |
211 | 213 | ||
212 | io_error: | 214 | io_error: |
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 8ab3cf10d792..7084ac9a6455 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -590,8 +590,8 @@ static void nfs_cancel_commit_list(struct list_head *head) | |||
590 | req = nfs_list_entry(head->next); | 590 | req = nfs_list_entry(head->next); |
591 | nfs_list_remove_request(req); | 591 | nfs_list_remove_request(req); |
592 | nfs_inode_remove_request(req); | 592 | nfs_inode_remove_request(req); |
593 | nfs_clear_page_writeback(req); | ||
594 | dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS); | 593 | dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS); |
594 | nfs_clear_page_writeback(req); | ||
595 | } | 595 | } |
596 | } | 596 | } |
597 | 597 | ||
@@ -1386,8 +1386,8 @@ nfs_commit_list(struct inode *inode, struct list_head *head, int how) | |||
1386 | req = nfs_list_entry(head->next); | 1386 | req = nfs_list_entry(head->next); |
1387 | nfs_list_remove_request(req); | 1387 | nfs_list_remove_request(req); |
1388 | nfs_mark_request_commit(req); | 1388 | nfs_mark_request_commit(req); |
1389 | nfs_clear_page_writeback(req); | ||
1390 | dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS); | 1389 | dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS); |
1390 | nfs_clear_page_writeback(req); | ||
1391 | } | 1391 | } |
1392 | return -ENOMEM; | 1392 | return -ENOMEM; |
1393 | } | 1393 | } |