casaroli commented on code in PR #19512:
URL: https://github.com/apache/nuttx/pull/19512#discussion_r3646848332


##########
fs/vfs/fs_dir.c:
##########
@@ -564,6 +564,22 @@ static int dir_ioctl(FAR struct file *filep, int cmd, 
unsigned long arg)
     }
   else if (cmd != BIOC_FLUSH)
     {
+#ifndef CONFIG_DISABLE_MOUNTPOINT
+      /* Not a command the VFS answers for a directory.  If this directory
+       * belongs to a mounted volume whose file system offers volume-wide
+       * commands, it is the one route to them that does not require an
+       * unrelated file to be open.
+       */
+
+      if (INODE_IS_MOUNTPT(dir->fd_root) &&
+          dir->fd_root->u.i_mops != NULL &&
+          dir->fd_root->u.i_mops->volume_ioctl != NULL)
+        {
+          return dir->fd_root->u.i_mops->volume_ioctl(dir->fd_root, cmd,

Review Comment:
   good call. I put in the last line instead of 339, so we do not need to 
update every FS code. WDYT?
   
   If you prefer we can put there at 339, and update all the fs.



-- 
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]

Reply via email to