rpmsgblk: bind block inode to ept when create ept

A segmentfault might happen when read/write/unlink ops called without an open
ops called because it bind ept's ops in rpmsgblk_open_handler.

proxy> rm /dev/ram1
segmentfault

proxy> ls /dev/ram1
segmentfault

Signed-off-by: liaoao <liaoao@xiaomi.com>
This commit is contained in:
liaoao
2023-10-09 21:09:00 +08:00
committed by Xiang Xiao
parent 57de6484e9
commit 27f672d55a
4 changed files with 60 additions and 49 deletions
+25
View File
@@ -1199,6 +1199,31 @@ int open_blockdriver(FAR const char *pathname, int mountflags,
int close_blockdriver(FAR struct inode *inode);
/****************************************************************************
* Name: find_blockdriver
*
* Description:
* Return the inode of the block driver specified by 'pathname'
*
* Input Parameters:
* pathname - The full path to the block driver to be located
* mountflags - If MS_RDONLY is not set, then driver must support write
* operations (see include/sys/mount.h)
* ppinode - Address of the location to return the inode reference
*
* Returned Value:
* Returns zero on success or a negated errno on failure:
*
* ENOENT - No block driver of this name is registered
* ENOTBLK - The inode associated with the pathname is not a block driver
* EACCESS - The MS_RDONLY option was not set but this driver does not
* support write access
*
****************************************************************************/
int find_blockdriver(FAR const char *pathname, int mountflags,
FAR struct inode **ppinode);
/****************************************************************************
* Name: find_mtddriver
*