kernel/fs: Check HAS_FS_CALL(..., open_dir) in open_dir_vnode.

All filesystems have open_dir calls in their vnode hooks,
but there are some vnode hooks that do not, like FIFOs.
Thus we need to check the hook actually exists.

Fixes #17870.
This commit is contained in:
Augustin Cavalier 2022-08-18 13:58:14 -04:00
parent e4e1e6e4f5
commit 8ba3797e85

View File

@ -5534,6 +5534,9 @@ create_vnode(struct vnode* directory, const char* name, int openMode,
static int
open_dir_vnode(struct vnode* vnode, bool kernel)
{
if (!HAS_FS_CALL(vnode, open_dir))
return B_UNSUPPORTED;
void* cookie;
status_t status = FS_CALL(vnode, open_dir, &cookie);
if (status != B_OK)