vfs:Remove extra put_vnode call on error B_LINK_LIMIT exit

Fixing the autoconf test: attempt to create file in place of already
existing symlink. On error exit put_vnode was called explicitly before
returning error. The second, implicit call to put_vnode was issued on
destroying the VNodePutter instance that references the same vnode. At
this time the vnode has references count equal to 0 so corresponding
panic was executed. Great thanks to Ingo for pointing it out!

Fixes #9140.
This commit is contained in:
Siarzhuk Zharski 2013-09-10 19:47:36 +02:00
parent 378a2b8580
commit 726e47bb80

View File

@ -5260,10 +5260,8 @@ create_vnode(struct vnode* directory, const char* name, int openMode,
putter.SetTo(vnode);
}
if ((openMode & O_NOFOLLOW) != 0 && S_ISLNK(vnode->Type())) {
put_vnode(vnode);
if ((openMode & O_NOFOLLOW) != 0 && S_ISLNK(vnode->Type()))
return B_LINK_LIMIT;
}
int fd = open_vnode(vnode, openMode & ~O_CREAT, kernel);
// on success keep the vnode reference for the FD