bfs_read_link() did not report the correct link size (it did not take the
terminating null byte into account) - thanks to Korli for reporting this. Inode::Create() will no longer publish symlink vnodes; instead, bfs_create_symlink() will publish the link when it is complete (ie. the actual link data had been written). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12822 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
1333009e1c
commit
bae7c12dba
@ -123,7 +123,8 @@ InodeAllocator::Keep()
|
||||
return status;
|
||||
}
|
||||
|
||||
status = publish_vnode(volume->ID(), fInode->ID(), fInode);
|
||||
if (!fInode->IsSymLink())
|
||||
status = publish_vnode(volume->ID(), fInode->ID(), fInode);
|
||||
|
||||
fTransaction = NULL;
|
||||
fInode = NULL;
|
||||
|
@ -841,13 +841,12 @@ bfs_create_symlink(void *_ns, void *_directory, const char *name, const char *pa
|
||||
// we don't have to do that here...
|
||||
status = link->WriteAt(transaction, 0, (const uint8 *)path, &length);
|
||||
}
|
||||
// ToDo: would be nice if Inode::Create() would wait with publish_vnode()
|
||||
// until here, so that the link can be accessed directly
|
||||
|
||||
if (status == B_OK)
|
||||
status = link->WriteBack(transaction);
|
||||
|
||||
// Inode::Create() left the inode locked in memory
|
||||
// Inode::Create() left the inode locked in memory, and also doesn't publish links
|
||||
publish_vnode(volume->ID(), id, link);
|
||||
put_vnode(volume->ID(), id);
|
||||
|
||||
if (status == B_OK) {
|
||||
@ -1344,7 +1343,7 @@ bfs_read_link(void *_ns, void *_node, char *buffer, size_t *_bufferSize)
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
*_bufferSize = strlcpy(buffer, inode->Node().short_symlink, bufferSize);
|
||||
*_bufferSize = strlcpy(buffer, inode->Node().short_symlink, bufferSize) + 1;
|
||||
if (*_bufferSize > bufferSize)
|
||||
return B_BUFFER_OVERFLOW;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user