aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/namei.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-12-23 16:33:07 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-23 16:33:07 -0500
commit849254e9bba985e281526b57c02562c7a49a2fcf (patch)
treea061f4de1c7b2836185e9d5bd4d7871c79692ca4 /fs/ocfs2/namei.c
parent6f40334694dce047d43c6f2cce255b596da6de50 (diff)
parent10cf1a02f444fdcd50be47cce3fa8bf08251dd9c (diff)
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2: ocfs2: Set i_nlink properly during reflink. ocfs2: Add reflinked file's inode to inode hash eariler. ocfs2: refcounttree.c cleanup. ocfs2: Find proper end cpos for a leaf refcount block.
Diffstat (limited to 'fs/ocfs2/namei.c')
-rw-r--r--fs/ocfs2/namei.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
index f010b22b1c44..3e9b46002f22 100644
--- a/fs/ocfs2/namei.c
+++ b/fs/ocfs2/namei.c
@@ -2108,6 +2108,7 @@ int ocfs2_create_inode_in_orphan(struct inode *dir,
2108 } 2108 }
2109 did_quota_inode = 1; 2109 did_quota_inode = 1;
2110 2110
2111 inode->i_nlink = 0;
2111 /* do the real work now. */ 2112 /* do the real work now. */
2112 status = ocfs2_mknod_locked(osb, dir, inode, 2113 status = ocfs2_mknod_locked(osb, dir, inode,
2113 0, &new_di_bh, parent_di_bh, handle, 2114 0, &new_di_bh, parent_di_bh, handle,
@@ -2136,6 +2137,7 @@ int ocfs2_create_inode_in_orphan(struct inode *dir,
2136 if (status < 0) 2137 if (status < 0)
2137 mlog_errno(status); 2138 mlog_errno(status);
2138 2139
2140 insert_inode_hash(inode);
2139leave: 2141leave:
2140 if (status < 0 && did_quota_inode) 2142 if (status < 0 && did_quota_inode)
2141 vfs_dq_free_inode(inode); 2143 vfs_dq_free_inode(inode);
@@ -2267,6 +2269,8 @@ int ocfs2_mv_orphaned_inode_to_new(struct inode *dir,
2267 di = (struct ocfs2_dinode *)di_bh->b_data; 2269 di = (struct ocfs2_dinode *)di_bh->b_data;
2268 le32_add_cpu(&di->i_flags, -OCFS2_ORPHANED_FL); 2270 le32_add_cpu(&di->i_flags, -OCFS2_ORPHANED_FL);
2269 di->i_orphaned_slot = 0; 2271 di->i_orphaned_slot = 0;
2272 inode->i_nlink = 1;
2273 ocfs2_set_links_count(di, inode->i_nlink);
2270 ocfs2_journal_dirty(handle, di_bh); 2274 ocfs2_journal_dirty(handle, di_bh);
2271 2275
2272 status = ocfs2_add_entry(handle, dentry, inode, 2276 status = ocfs2_add_entry(handle, dentry, inode,
@@ -2284,7 +2288,6 @@ int ocfs2_mv_orphaned_inode_to_new(struct inode *dir,
2284 goto out_commit; 2288 goto out_commit;
2285 } 2289 }
2286 2290
2287 insert_inode_hash(inode);
2288 dentry->d_op = &ocfs2_dentry_ops; 2291 dentry->d_op = &ocfs2_dentry_ops;
2289 d_instantiate(dentry, inode); 2292 d_instantiate(dentry, inode);
2290 status = 0; 2293 status = 0;