Skip to contentSkip to conversation

+ r-o-bind-mount-clean-up-ocfs2-nlink-handling.patch added to -mm tree

DISCUSSION Daniel Walker 2 participants 3 messages Aug 10, 2006 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Review

Quoted 9 lines · On Wed, 2006-08-09 at 12:12 -0700, [email protected] wrote:
(quoted diff) +3 -3
-	/* We can set nlink on the dinode now. clear the saved version
-	 * so that it doesn't get set later. */
+	if (S_ISDIR(inode->i_mode))
+		drop_nlink(inode);
+	drop_nlink(inode);
 	fe->i_links_count = cpu_to_le16(inode->i_nlink);
-	saved_nlink = 0;
 
 	status = ocfs2_journal_dirty(handle, fe_bh);

There's one too many drop_nlink()'s in this block, unless I'm not reading this right.

Daniel

#2 lore raw
Quoted 9 lines · Daniel Walker
Quoted 8 lines · On Wed, 2006-08-09 at 12:12 -0700, [email protected] wrote:
(quoted diff) +3 -3
-	/* We can set nlink on the dinode now. clear the saved version
-	 * so that it doesn't get set later. */
+	if (S_ISDIR(inode->i_mode))
+		drop_nlink(inode);
+	drop_nlink(inode);
 	fe->i_links_count = cpu_to_le16(inode->i_nlink);
-	saved_nlink = 0;
Quoted 4 lines
Quoted 1 line

status = ocfs2_journal_dirty(handle, fe_bh);

There's one too many drop_nlink()'s in this block, unless I'm not reading this right.

It needs to be double-dropped for any directory inodes. Some of the older code just did i_nlink-=2, and I chose to just call drop_nlink() twice instead of making another helper to do arbitrary arithmetic on i_nlink.

I believe this made up for the

        if (S_ISDIR(inode->i_mode))
                inode->i_nlink = 0;

in the old code.

-- Dave

#3 lore raw
Quoted 8 lines · Dave Hansen
Quoted 2 lines

There's one too many drop_nlink()'s in this block, unless I'm not reading this right.

It needs to be double-dropped for any directory inodes. Some of the older code just did i_nlink-=2, and I chose to just call drop_nlink() twice instead of making another helper to do arbitrary arithmetic on i_nlink.

Quoted 6 lines

I believe this made up for the

        if (S_ISDIR(inode->i_mode))
                inode->i_nlink = 0;

in the old code.

Ok, I had a feeling it was something like that .. A comment around there might be helpful though, so people don't query you on in the future.

Daniel