fs_fsync: should not call fs's ioctl when fs not support sync api

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
This commit is contained in:
wangbowen6 2023-04-18 14:11:08 +08:00 committed by Xiang Xiao
parent 279667a8f5
commit 7117d3ea8a

View File

@ -64,12 +64,14 @@ int file_fsync(FAR struct file *filep)
if (inode != NULL)
{
#ifndef CONFIG_DISABLE_MOUNTPOINT
if (INODE_IS_MOUNTPT(inode) && inode->u.i_mops &&
inode->u.i_mops->sync)
if (INODE_IS_MOUNTPT(inode))
{
/* Yes, then tell the mountpoint to sync this file */
if (inode->u.i_mops && inode->u.i_mops->sync)
{
/* Yes, then tell the mountpoint to sync this file */
return inode->u.i_mops->sync(filep);
return inode->u.i_mops->sync(filep);
}
}
else
#endif