kernel/fs: Account for vnode being NULL in vfs_release_posix_lock.
When the FD is put() but not freed while O_DISCONNECTED, its "ops" and "vnode" are cleared. Thus it is entirely valid for a non-NULL file FD to have a NULL vnode, so we should just treat such FDs as if the locks had already been cleared (which they should have.) Fixes #14294.
This commit is contained in:
@@ -4891,6 +4891,8 @@ status_t
|
|||||||
vfs_release_posix_lock(io_context* context, struct file_descriptor* descriptor)
|
vfs_release_posix_lock(io_context* context, struct file_descriptor* descriptor)
|
||||||
{
|
{
|
||||||
struct vnode* vnode = descriptor->u.vnode;
|
struct vnode* vnode = descriptor->u.vnode;
|
||||||
|
if (vnode == NULL)
|
||||||
|
return B_OK;
|
||||||
|
|
||||||
if (HAS_FS_CALL(vnode, release_lock))
|
if (HAS_FS_CALL(vnode, release_lock))
|
||||||
return FS_CALL(vnode, release_lock, descriptor->cookie, NULL);
|
return FS_CALL(vnode, release_lock, descriptor->cookie, NULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user