aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/namei.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-08-01 19:56:03 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-08-01 19:56:03 -0400
commit60ad4466821a96913a9b567115e194ed1087c2d7 (patch)
treecd488ba72a60f856b85a467763fb633cbe7ef2d9 /fs/ext4/namei.c
parent1b8e94993c4752d98c33903aa836acc15f7e6d5c (diff)
parent79a77c5ac34cc27ccbfbdf7113b41cdd93534eab (diff)
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (60 commits) ext4: prevent memory leaks from ext4_mb_init_backend() on error path ext4: use EXT4_BAD_INO for buddy cache to avoid colliding with valid inode # ext4: use ext4_msg() instead of printk in mballoc ext4: use ext4_kvzalloc()/ext4_kvmalloc() for s_group_desc and s_group_info ext4: introduce ext4_kvmalloc(), ext4_kzalloc(), and ext4_kvfree() ext4: use the correct error exit path in ext4_init_inode_table() ext4: add missing kfree() on error return path in add_new_gdb() ext4: change umode_t in tracepoint headers to be an explicit __u16 ext4: fix races in ext4_sync_parent() ext4: Fix overflow caused by missing cast in ext4_fallocate() ext4: add action of moving index in ext4_ext_rm_idx for Punch Hole ext4: simplify parameters of reserve_backup_gdb() ext4: simplify parameters of add_new_gdb() ext4: remove lock_buffer in bclean() and setup_new_group_blocks() ext4: simplify journal handling in setup_new_group_blocks() ext4: let setup_new_group_blocks() set multiple bits at a time ext4: fix a typo in ext4_group_extend() ext4: let ext4_group_add_blocks() handle 0 blocks quickly ext4: let ext4_group_add_blocks() return an error code ext4: rename ext4_add_groupblocks() to ext4_group_add_blocks() ... Fix up conflict in fs/ext4/inode.c: commit aacfc19c626e ("fs: simplify the blockdev_direct_IO prototype") had changed the ext4_ind_direct_IO() function for the new simplified calling convention, while commit dae1e52cb126 ("ext4: move ext4_ind_* functions from inode.c to indirect.c") moved the function to another file.
Diffstat (limited to 'fs/ext4/namei.c')
-rw-r--r--fs/ext4/namei.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 8c9babac43dc..565a154e22d4 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -289,7 +289,7 @@ static struct stats dx_show_leaf(struct dx_hash_info *hinfo, struct ext4_dir_ent
289 while (len--) printk("%c", *name++); 289 while (len--) printk("%c", *name++);
290 ext4fs_dirhash(de->name, de->name_len, &h); 290 ext4fs_dirhash(de->name, de->name_len, &h);
291 printk(":%x.%u ", h.hash, 291 printk(":%x.%u ", h.hash,
292 ((char *) de - base)); 292 (unsigned) ((char *) de - base));
293 } 293 }
294 space += EXT4_DIR_REC_LEN(de->name_len); 294 space += EXT4_DIR_REC_LEN(de->name_len);
295 names++; 295 names++;
@@ -1013,7 +1013,7 @@ static struct buffer_head * ext4_dx_find_entry(struct inode *dir, const struct q
1013 1013
1014 *err = -ENOENT; 1014 *err = -ENOENT;
1015errout: 1015errout:
1016 dxtrace(printk(KERN_DEBUG "%s not found\n", name)); 1016 dxtrace(printk(KERN_DEBUG "%s not found\n", d_name->name));
1017 dx_release (frames); 1017 dx_release (frames);
1018 return NULL; 1018 return NULL;
1019} 1019}
@@ -1985,18 +1985,11 @@ int ext4_orphan_add(handle_t *handle, struct inode *inode)
1985 if (!list_empty(&EXT4_I(inode)->i_orphan)) 1985 if (!list_empty(&EXT4_I(inode)->i_orphan))
1986 goto out_unlock; 1986 goto out_unlock;
1987 1987
1988 /* Orphan handling is only valid for files with data blocks 1988 /*
1989 * being truncated, or files being unlinked. */ 1989 * Orphan handling is only valid for files with data blocks
1990 1990 * being truncated, or files being unlinked. Note that we either
1991 /* @@@ FIXME: Observation from aviro: 1991 * hold i_mutex, or the inode can not be referenced from outside,
1992 * I think I can trigger J_ASSERT in ext4_orphan_add(). We block 1992 * so i_nlink should not be bumped due to race
1993 * here (on s_orphan_lock), so race with ext4_link() which might bump
1994 * ->i_nlink. For, say it, character device. Not a regular file,
1995 * not a directory, not a symlink and ->i_nlink > 0.
1996 *
1997 * tytso, 4/25/2009: I'm not sure how that could happen;
1998 * shouldn't the fs core protect us from these sort of
1999 * unlink()/link() races?
2000 */ 1993 */
2001 J_ASSERT((S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) || 1994 J_ASSERT((S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
2002 S_ISLNK(inode->i_mode)) || inode->i_nlink == 0); 1995 S_ISLNK(inode->i_mode)) || inode->i_nlink == 0);