[Ocfs2-devel] a patch for ocfs2_link
Joel Becker
Joel.Becker at oracle.com
Thu Aug 31 20:06:33 PDT 2006
On Fri, Sep 01, 2006 at 10:27:32AM +0800, Tiger Yang wrote:
> diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
> index 0673862..719a8d2 100644
> --- a/fs/ocfs2/namei.c
> +++ b/fs/ocfs2/namei.c
> @@ -643,11 +643,6 @@ static int ocfs2_link(struct dentry *old
> goto bail;
> }
>
> - if (inode->i_nlink >= OCFS2_LINK_MAX) {
> - err = -EMLINK;
> - goto bail;
> - }
> -
Why is this redundant? Is someone doing it for us? I see we
check the fe->i_links_count below, but that's after the expense of a
cluster lock. Don't we save some effort here?
> @@ -661,6 +656,11 @@ static int ocfs2_link(struct dentry *old
> goto bail;
> }
>
> + if (!dir->i_nlink) {
> + err = -ENOENT;
> + goto bail;
> + }
> +
And what does this do? If a directory...oh, wait, is this to
check for a directory that's going away? Can this actually happen? I'd
think that the VFS would protect it.
Joel
--
"Well-timed silence hath more eloquence than speech."
- Martin Fraquhar Tupper
Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127
More information about the Ocfs2-devel
mailing list