This is an automated email from the ASF dual-hosted git repository. xiaoxiang pushed a commit to branch releases/10.0 in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/releases/10.0 by this push: new 837f2b7 Revert "fs/nxffs: Fix scan good block slowly and scan an invalid block" 837f2b7 is described below commit 837f2b7c5fd4cf04f21f9f612c8abc894a1aa0f3 Author: Brennan Ashton <bash...@brennanashton.com> AuthorDate: Wed Nov 18 21:35:57 2020 -0800 Revert "fs/nxffs: Fix scan good block slowly and scan an invalid block" This reverts commit 97be116a39fee62b8f7027fd93d93789a6d04abb. This commit broke nxffs. This leaves the first block as empty which then exposes another bug where when the pack is called because we have reached the end of flash and need to look for deleted inodes we search the first block find no inode and assume that there are no more inodes. This then results in corrupting the filesystem by writing over existing inodes. This can be seen by runing the sim:nxffs configuration. Prior to this commit the first pass of writing files would look like this: NXFFS Dump: BLOCK:OFFS TYPE STATE LENGTH 0:5 INODE OK 2680 0:78 DATA OK 424 1:5 DATA OK 497 2:5 DATA OK 497 3:5 DATA OK 497 4:5 DATA OK 497 5:5 DATA OK 268 5:283 INODE OK 7410 5:425 DATA OK 77 6:5 DATA OK 497 With this commit: NXFFS Dump: BLOCK:OFFS TYPE STATE LENGTH 0:0 BLOCK ERASED 512 1:5 INODE OK 6394 1:39 DATA OK 463 2:5 DATA OK 497 3:5 DATA OK 497 Signed-off-by: Brennan Ashton <bash...@brennanashton.com> --- fs/nxffs/nxffs_initialize.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/fs/nxffs/nxffs_initialize.c b/fs/nxffs/nxffs_initialize.c index 8491d6c..5695a72 100644 --- a/fs/nxffs/nxffs_initialize.c +++ b/fs/nxffs/nxffs_initialize.c @@ -495,11 +495,7 @@ int nxffs_limits(FAR struct nxffs_volume_s *volume) } else { - volume->ioblock += 1; - volume->iooffset = SIZEOF_NXFFS_BLOCK_HDR; - - offset = volume->ioblock * volume->geo.blocksize + - volume->iooffset; + offset += nerased + 1; nerased = 0; } }