Skip to content

[BUG] stat() does not work on flash partition with BCH layer #16074

Open
@michallenc

Description

@michallenc

Description / Steps to reproduce the issue

Flash partition configured as BCH layer (device driver created with bchdev_register) doesn't allow stat call to obtain the information about an underlying MTD device/flash. This is caused by INODE_IS_MTD not being set and thus
function inode_stat falls to the last else statement and does not fill the necessary information.

This is a logical output as BCH layer is registered as a standard character device driver, therefore it is not considered as MTD but as a standard driver (ADC, PWM, etc.). This, however, makes the stat call unusable for it.

We should probably find a way how to pass an information there is a MTD device under the driver and that we should access it with a standard MTDIOC_GEOMETRY ioctl to obtain the required information and pass them to the user.

On which OS does this issue occur?

[OS: Linux]

What is the version of your OS?

Ubuntu 22.04.5 LTS

NuttX Version

master

Issue Architecture

[Arch: all]

Issue Area

[Area: Kernel], [Area: Drivers]

Host information

No response

Verification

  • I have verified before submitting the report.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Arch: allIssues that apply to all architecturesArea: DriversDrivers issuesArea: KernelKernel issuesOS: LinuxIssues related to Linux (building system, etc)Type: BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions