[haiku-development] Re: publish_vnode / get_vnode

Brecht Machiels wrote:
Ingo Weinhold wrote:
Any ideas? Of course, st_blocks has to be filled in, so something is
definitely wrong here...

Haiku's struct stat has changed recently. You're not by any chance using some unhealthy mix of old userlandfs and newer headers or vice versa? At least BFS compiled for userland seems to work well with the current version, so I'd assume userlandfs is working correctly.

I'd already thought of that (yay). Unfortunately, what's causing the problems is even more stupid. The UFS kernel addon and server were still linked to my release builds (from April 12)!

Now that I can take advantage of userlandfs debug logging, I see that get_vnode gets called after all, at least in the userlandfs kernel addon:

KERN: userlandfs [11446223096: 64901] userlandfs_open_dir(0x810be0cc, 0x8a324d20) KERN: userlandfs [11446230356: 64901] userlandfs_open_dir() done: (0, 0x1805fa28) KERN: userlandfs [11446240414: 64901] userlandfs_read_dir(0x810be0cc, 0x8a324d20, 0x1805fa28, 0x1802f7b0, 4088, 65535) KERN: userlandfs [11446250974: 64901] Volume::ReadDir(): buffer returned: 4088 bytes
KERN: userlandfs [11446263210: 64901] userlandfs_read_dir() done: (0, 1)
KERN: userlandfs [11446269085: 64901] entry: d_dev: 12, d_pdev: 0, d_ino: 1, d_pino: 0, d_reclen: 29, d_name: `libs' KERN: userlandfs [11446279054: 64901] userlandfs_get_vnode(0x810be0cc, 1, 0x00000000, 0) KERN: userlandfs [11446286425: 64901] userlandfs_get_vnode() done: (80000005, 0x00000001, 0x1802f7ca, 0x8c7a3d82) KERN: userlandfs [11446295888: 64901] userlandfs_close_dir(0x810be0cc, 0x8a324d20, 0x1805fa28)
KERN: userlandfs [11446310436: 64901] userlandfs_close_dir() done: 0

Following the path from UFS kernel addon to UFS server, I see that the end-point is:

// ReadVNode
Volume::ReadVNode(ino_t vnid, bool reenter, void** node, int* type,
        uint32* flags, FSVNodeCapabilities* _capabilities)
        return B_BAD_VALUE;

Which would explain the "Invalid argument" (0x80000005) error ls returns. I'm not sure why the same doesn't happen with BFS for you. Perhaps BFS does publish each node. I'll check with userland BFS tomorrow if I find the time.


Other related posts: