aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/namei.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/namei.c')
-rw-r--r--fs/ext4/namei.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index de04013d16ff..6d2c1b897fc7 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -1590,9 +1590,9 @@ static int ext4_dx_add_entry(handle_t *handle, struct dentry *dentry,
1590 goto cleanup; 1590 goto cleanup;
1591 node2 = (struct dx_node *)(bh2->b_data); 1591 node2 = (struct dx_node *)(bh2->b_data);
1592 entries2 = node2->entries; 1592 entries2 = node2->entries;
1593 memset(&node2->fake, 0, sizeof(struct fake_dirent));
1593 node2->fake.rec_len = ext4_rec_len_to_disk(sb->s_blocksize, 1594 node2->fake.rec_len = ext4_rec_len_to_disk(sb->s_blocksize,
1594 sb->s_blocksize); 1595 sb->s_blocksize);
1595 node2->fake.inode = 0;
1596 BUFFER_TRACE(frame->bh, "get_write_access"); 1596 BUFFER_TRACE(frame->bh, "get_write_access");
1597 err = ext4_journal_get_write_access(handle, frame->bh); 1597 err = ext4_journal_get_write_access(handle, frame->bh);
1598 if (err) 1598 if (err)
@@ -2068,7 +2068,8 @@ int ext4_orphan_del(handle_t *handle, struct inode *inode)
2068 struct ext4_iloc iloc; 2068 struct ext4_iloc iloc;
2069 int err = 0; 2069 int err = 0;
2070 2070
2071 if (!ext4_handle_valid(handle)) 2071 /* ext4_handle_valid() assumes a valid handle_t pointer */
2072 if (handle && !ext4_handle_valid(handle))
2072 return 0; 2073 return 0;
2073 2074
2074 mutex_lock(&EXT4_SB(inode->i_sb)->s_orphan_lock); 2075 mutex_lock(&EXT4_SB(inode->i_sb)->s_orphan_lock);
@@ -2310,7 +2311,7 @@ static int ext4_link(struct dentry *old_dentry,
2310 struct inode *inode = old_dentry->d_inode; 2311 struct inode *inode = old_dentry->d_inode;
2311 int err, retries = 0; 2312 int err, retries = 0;
2312 2313
2313 if (EXT4_DIR_LINK_MAX(inode)) 2314 if (inode->i_nlink >= EXT4_LINK_MAX)
2314 return -EMLINK; 2315 return -EMLINK;
2315 2316
2316 /* 2317 /*
@@ -2413,7 +2414,7 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry,
2413 goto end_rename; 2414 goto end_rename;
2414 retval = -EMLINK; 2415 retval = -EMLINK;
2415 if (!new_inode && new_dir != old_dir && 2416 if (!new_inode && new_dir != old_dir &&
2416 new_dir->i_nlink >= EXT4_LINK_MAX) 2417 EXT4_DIR_LINK_MAX(new_dir))
2417 goto end_rename; 2418 goto end_rename;
2418 } 2419 }
2419 if (!new_bh) { 2420 if (!new_bh) {
@@ -2536,7 +2537,7 @@ const struct inode_operations ext4_dir_inode_operations = {
2536 .listxattr = ext4_listxattr, 2537 .listxattr = ext4_listxattr,
2537 .removexattr = generic_removexattr, 2538 .removexattr = generic_removexattr,
2538#endif 2539#endif
2539 .permission = ext4_permission, 2540 .check_acl = ext4_check_acl,
2540 .fiemap = ext4_fiemap, 2541 .fiemap = ext4_fiemap,
2541}; 2542};
2542 2543
@@ -2548,5 +2549,5 @@ const struct inode_operations ext4_special_inode_operations = {
2548 .listxattr = ext4_listxattr, 2549 .listxattr = ext4_listxattr,
2549 .removexattr = generic_removexattr, 2550 .removexattr = generic_removexattr,
2550#endif 2551#endif
2551 .permission = ext4_permission, 2552 .check_acl = ext4_check_acl,
2552}; 2553};