fs/vfs/fs_lock.c: support flock for SHM driver

We can apply file lock on SHM inode as well. Ensure file_lock_get_path
function passes and doesn't return EBADF errno.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
This commit is contained in:
Michal Lenc 2026-06-10 16:05:02 +02:00 committed by Lup Yuen Lee
parent 726dd10bcd
commit e1a9b953e2

View file

@ -102,10 +102,13 @@ static int file_lock_get_path(FAR struct file *filep, FAR char *path)
FAR struct tcb_s *tcb = this_task();
bool is_allowed_type;
/* We only apply file lock on mountpt and driver (f_inode won't be NULL). */
/* We only apply file lock on mountpt, driver or shm
* (f_inode won't be NULL).
*/
is_allowed_type = INODE_IS_MOUNTPT(filep->f_inode) ||
INODE_IS_DRIVER(filep->f_inode);
INODE_IS_DRIVER(filep->f_inode) ||
INODE_IS_SHM(filep->f_inode);
if (!is_allowed_type || tcb->flags & TCB_FLAG_SIGNAL_ACTION)
{