lkml.org 
[lkml]   [2001]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: vfs_symlink return NULL inode


On Sat, 22 Sep 2001, David Chow wrote:

> Dear all,
>
> I have one question from using vfs_symlink, is it usual after I called
> vfs_symlink that will return a dentry with dentry->d_inode == NULL???

vfs_symlink() returns an integer, not dentry.

> The link was sucessfully created but I receive a null inode pointer.
> When creating a symlink it should also create an inode. But according to
> the documentation about VFS from Richard, the symlink call of
> inode_operations, should self call d_instantiate() this also means it
> should automatically create an inode pointer. This shouldn't be done by
> the caller???? Any hints? the vfs_create works fine and return with a
> proper inode number, why vfs_symlink doesn't? Thanks.

No, it doesn't. vfs_create() returns 0 in case of success and small negative
number in case of error. Neither has any relation to inode numbers.

dentry you've passed to it is modified - it gets non-NULL ->d_inode _if_
operation succeeded. Which is not guaranteed - depends on kind of filesystem,
length of symlink body, permissions, etc.

So unless you tell what you are passing to vfs_symlink(), what does it
return, etc. - there's nothing anyone could do. We might be smart, by
I'm not aware of anybody here being telepathic.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:03    [W:0.064 / U:0.828 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site