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


##########
drivers/mtd/ftl.c:
##########
@@ -869,7 +870,7 @@ static int ftl_ioctl(FAR struct inode *inode, int cmd, 
unsigned long arg)
   if (cmd == BIOC_FLUSH)
     {
 #ifdef CONFIG_FTL_WRITEBUFFER
-      rwb_flush(&dev->rwb);
+      return rwb_flush(&dev->rwb);

Review Comment:
   With CONFIG_FTL_WRITEBUFFER, BIOC_FLUSH now returns here and no longer 
reaches `MTD_IOCTL(dev->mtd, cmd, arg)` below; on master the MTD driver gets 
BIOC_FLUSH after the write buffer flush. The body says "successful flush 
behavior is unchanged".
   
   Fix: return only on an error: `ret = rwb_flush(&dev->rwb); if (ret < 0) { 
return ret; }`, and keep the fall-through to `MTD_IOCTL()`.



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