apache / apache/nuttx

[BUG] nxffs test

Open
#16,528 3 comments 0 reactions 0 assignees View on GitHub
Arch: arm64 Area: File System OS: Linux Type: Bug
Dominant language
C
Stars
4k
Forks
1.7k
Avg merge
1d 17h
Merged PRs (30d)
237

Description

### Description / Steps to reproduce the issue

1. Using an AArch64-based SoC with SPI interface to control a W25-series Flash (e.g., W25Q128).
2. The following functions are called in sequence:
w25_initialize() (SPI Flash driver initialization)
nxffs_initialize() (NXFFS filesystem setup)
nx_mount() (mounting the filesystem)
3. Nxffs test config as follow
CONFIG_TESTING_NXFFS_NEBLOCKS=32
CONFIG_TESTING_NXFFS_MAXNAME=24
CONFIG_TESTING_NXFFS_MAXFILE=1024
CONFIG_TESTING_NXFFS_MAXIO=347
CONFIG_TESTING_NXFFS_MAXOPEN=32
CONFIG_TESTING_NXFFS_MOUNTPT="/mnt/w25a"
CONFIG_TESTING_NXFFS_NLOOPS=2
4. Running nxffs command in shell

### On which OS does this issue occur?

[OS: Linux]

### What is the version of your OS?

Ubuntu22.04

### NuttX Version

release 12.4

### Issue Architecture

[Arch: arm64]

### Issue Area

[Area: File System]

### Host information

After executing nxffs operations, there is a probabilistic occurrence where:

The first file is successfully created and written with data.
However, the file fails to be detected during nxffs_directory scanning.
Consequently, subsequent calls to nxffs_rdfile result in the error:
```ERROR: Failed to open file for reading: 2```

Through repeated testing, we've confirmed this file loss exclusively affects the first created file.

![Image](https://github.com/user-attachments/assets/0cc2dbf3-6706-4703-b483-e7111c99c41a)

![Image](https://github.com/user-attachments/assets/c936d7ab-3353-4df5-b158-d93265265e89)

### Verification

- [x] I have verified before submitting the report.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.