[haiku-commits] haiku: hrev46039 - src/system/kernel/fs

  • From: zharik@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 10 Sep 2013 20:00:00 +0200 (CEST)

hrev46039 adds 1 changeset to branch 'master'
old head: 378a2b8580ccd801cac363a83a6ea1fd35f199ca
new head: 726e47bb80d83fe6af11edd409e5949d66102b9e
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=726e47b+%5E378a2b8

----------------------------------------------------------------------------

726e47b: 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.

                                        [ Siarzhuk Zharski <zharik@xxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev46039
Commit:      726e47bb80d83fe6af11edd409e5949d66102b9e
URL:         http://cgit.haiku-os.org/haiku/commit/?id=726e47b
Author:      Siarzhuk Zharski <zharik@xxxxxx>
Date:        Tue Sep 10 17:47:36 2013 UTC

Ticket:      https://dev.haiku-os.org/ticket/9140

----------------------------------------------------------------------------

1 file changed, 1 insertion(+), 3 deletions(-)
src/system/kernel/fs/vfs.cpp | 4 +---

----------------------------------------------------------------------------

diff --git a/src/system/kernel/fs/vfs.cpp b/src/system/kernel/fs/vfs.cpp
index 0b5371b..9170733 100644
--- a/src/system/kernel/fs/vfs.cpp
+++ b/src/system/kernel/fs/vfs.cpp
@@ -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


Other related posts:

  • » [haiku-commits] haiku: hrev46039 - src/system/kernel/fs - zharik