xiaoxiang781216 commented on a change in pull request #2572:
URL: https://github.com/apache/incubator-nuttx/pull/2572#discussion_r546546091



##########
File path: fs/spiffs/src/spiffs_vfs.c
##########
@@ -408,7 +416,8 @@ static int spiffs_open(FAR struct file *filep, FAR const 
char *relpath,
 
   /* Check of the file object already exists */
 
-  ret = spiffs_find_objhdr_pgndx(fs, (FAR const uint8_t *)relpath, &pgndx);
+  ret = spiffs_find_objhdr_pgndx(fs, (FAR const uint8_t *)spiffs_relpath,

Review comment:
       > the structure with this PR should be compatible with:
   > 
   > * https://github.com/pellepl/spiffs (the version used by mkspiffs. i dunno 
if 0.4.0 changed it or not)
   > * https://github.com/igrr/mkspiffs
   > * ESP-IDF spiffsgen.py
   
   If so, we need change the NuttX version to confirm the standard as soon as 
possible.
   
   > > And these patches also don't need anymore:
   > > fs/spiffs/Kconfig: Update the description of SPIFFS_NAME_MAX
   > > spiffs: Fix statfs f_namelen
   > 
   > i'm not sure about this point.
   > do you prefer to keep SPIFFS_NAME_MAX not including the leading '/'?
   > in that case, a user need to specify SPIFFS_NAME_MAX+1 for tools like 
mkspiffs.
   
   From your patch, '/' is always inserted before the relpath. If 
spiffs_find_objhdr_pgndx can handle relpath without the leading '/' correctly. 
Then we don't need reserve one space for '/'?




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to