From 62b71c3b3041fadd985899abe669e78f08ad0574 Mon Sep 17 00:00:00 2001 From: Jari Nippula Date: Fri, 24 Apr 2026 14:44:17 +0300 Subject: [PATCH] fs/vfs/fs_lock.c: Close stale locks unconditionally Allow to close the lock even the dying task is in signal handler context. Also the file type check can be ignored as they are already validated in create phase. Signed-off-by: Jari Nippula --- fs/vfs/fs_lock.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/vfs/fs_lock.c b/fs/vfs/fs_lock.c index f685eace90c..535b35ec39f 100644 --- a/fs/vfs/fs_lock.c +++ b/fs/vfs/fs_lock.c @@ -784,7 +784,11 @@ void file_closelk(FAR struct file *filep) return; } - ret = file_lock_get_path(filep, path); + /* No need for inode type and signal handler context (e.g. "kill") checking + * here, but just get path unconditionally. + */ + + ret = file_fcntl(filep, F_GETPATH, path); if (ret < 0) { /* It isn't an error if fs doesn't support F_GETPATH, so we just end