* Re: + r-o-bind-mount-clean-up-ocfs2-nlink-handling.patch added to -mm tree
[not found] <200608091912.k79JCnGh027465@shell0.pdx.osdl.net>
@ 2006-08-10 13:56 ` Daniel Walker
2006-08-10 16:02 ` Dave Hansen
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Walker @ 2006-08-10 13:56 UTC (permalink / raw)
To: linux-kernel; +Cc: haveblue, hch, mark.fasheh, viro
On Wed, 2006-08-09 at 12:12 -0700, akpm@osdl.org wrote:
> - /* 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: + r-o-bind-mount-clean-up-ocfs2-nlink-handling.patch added to -mm tree
2006-08-10 13:56 ` + r-o-bind-mount-clean-up-ocfs2-nlink-handling.patch added to -mm tree Daniel Walker
@ 2006-08-10 16:02 ` Dave Hansen
2006-08-10 16:07 ` Daniel Walker
0 siblings, 1 reply; 3+ messages in thread
From: Dave Hansen @ 2006-08-10 16:02 UTC (permalink / raw)
To: Daniel Walker; +Cc: linux-kernel, hch, mark.fasheh, viro
On Thu, 2006-08-10 at 06:56 -0700, Daniel Walker wrote:
> On Wed, 2006-08-09 at 12:12 -0700, akpm@osdl.org wrote:
> > - /* 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.
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: + r-o-bind-mount-clean-up-ocfs2-nlink-handling.patch added to -mm tree
2006-08-10 16:02 ` Dave Hansen
@ 2006-08-10 16:07 ` Daniel Walker
0 siblings, 0 replies; 3+ messages in thread
From: Daniel Walker @ 2006-08-10 16:07 UTC (permalink / raw)
To: Dave Hansen; +Cc: linux-kernel, hch, mark.fasheh, viro
On Thu, 2006-08-10 at 09:02 -0700, Dave Hansen wrote:
> > 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.
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-08-10 16:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <200608091912.k79JCnGh027465@shell0.pdx.osdl.net>
2006-08-10 13:56 ` + r-o-bind-mount-clean-up-ocfs2-nlink-handling.patch added to -mm tree Daniel Walker
2006-08-10 16:02 ` Dave Hansen
2006-08-10 16:07 ` Daniel Walker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox