All of lore.kernel.org
 help / color / mirror / Atom feed
* vfs_symlink return NULL inode
@ 2001-09-22  6:39 David Chow
  2001-09-22 12:52 ` Alexander Viro
  0 siblings, 1 reply; 3+ messages in thread
From: David Chow @ 2001-09-22  6:39 UTC (permalink / raw)
  To: linux-kernel

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???
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.

regards,

David Chow

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: vfs_symlink return NULL inode
  2001-09-22  6:39 vfs_symlink return NULL inode David Chow
@ 2001-09-22 12:52 ` Alexander Viro
  2001-09-23  2:49   ` David Chow
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Viro @ 2001-09-22 12:52 UTC (permalink / raw)
  To: David Chow; +Cc: linux-kernel



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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: vfs_symlink return NULL inode
  2001-09-22 12:52 ` Alexander Viro
@ 2001-09-23  2:49   ` David Chow
  0 siblings, 0 replies; 3+ messages in thread
From: David Chow @ 2001-09-23  2:49 UTC (permalink / raw)
  To: Alexander Viro; +Cc: linux-kernel

On Sat, 22 Sep 2001, Alexander Viro wrote:

>
>
> 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.
>
I shouldn't say return, it is the dentry that I pass to vfs_symlink() and
vfs_create(). The dentry passed to vfs_create did pass back a proper
dentry->d_inode. For the vfs_symlink() it didn't?? Even the link was
sucessfully created on the filesystem. The dentry->d_inode is NULL. That's
the story... thanks.

regards,

David Chow


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-09-23  2:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-09-22  6:39 vfs_symlink return NULL inode David Chow
2001-09-22 12:52 ` Alexander Viro
2001-09-23  2:49   ` David Chow

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.