LingaoM commented on code in PR #19456:
URL: https://github.com/apache/nuttx/pull/19456#discussion_r3626926720
##########
fs/hostfs/hostfs.c:
##########
@@ -616,6 +610,16 @@ static int hostfs_ioctl(FAR struct file *filep, int cmd,
unsigned long arg)
{
switch (cmd)
{
+ case FIOC_GETLK:
+ case FIOC_SETLK:
+ case FIOC_SETLKW:
Review Comment:
One tradeoff is that the fallback condition lives in VFS, not in hostfs:
`fs/vfs/fs_ioctl.c` only falls back to `file_getlk()` / `file_setlk()` when the
filesystem ioctl returns `-ENOTTY`.
So if we remove the `FIOC_*LK` special case from `fs/hostfs/hostfs.c`,
each hostfs backend that does not implement host ioctl needs to report
"unsupported ioctl" as `-ENOTTY` instead of `-ENOSYS`. Otherwise
ARM/ARM64/RISC-V/XTensa/Windows hostfs would return `-ENOSYS` for `FIOC_*LK`
and VFS would not fall back.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]