This is an automated email from the ASF dual-hosted git repository.

ligd pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 322765b4427a32ddb687c4633f7e76a481c6fec7
Author: Xiang Xiao <[email protected]>
AuthorDate: Sun Jul 28 15:33:40 2024 +0800

    fs/romfs: Align up the file size to 16 bytes
    
    and set volume size to 96 bytes in romfs_mkfs
    
    Signed-off-by: Xiang Xiao <[email protected]>
---
 fs/romfs/fs_romfsutil.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/romfs/fs_romfsutil.c b/fs/romfs/fs_romfsutil.c
index debcdd7926..d9cfd4af9f 100644
--- a/fs/romfs/fs_romfsutil.c
+++ b/fs/romfs/fs_romfsutil.c
@@ -650,7 +650,7 @@ static int romfs_cachenode(FAR struct romfs_mountpt_s *rm,
       uint32_t totalsize = ROMFS_ALIGNUP(ROMFS_FHDR_NAME + nsize + 1);
       if (offset == origoffset)
         {
-          totalsize += size;
+          totalsize += ROMFS_ALIGNUP(size);
         }
 
       rm->rm_volsize += totalsize;
@@ -1463,9 +1463,9 @@ int romfs_mkfs(FAR struct romfs_mountpt_s *rm)
 
   romfs_devmemcpy(rm, ROMFS_VHDR_ROM1FS, ROMFS_VHDR_MAGIC, ROMFS_VHDR_SIZE);
 
-  /* Init the ROMFS volume to zero */
+  /* Init the ROMFS volume size */
 
-  romfs_devwrite32(rm, ROMFS_VHDR_SIZE, 0);
+  romfs_devwrite32(rm, ROMFS_VHDR_SIZE, 0x60);
 
   /* Write the volume name */
 

Reply via email to