Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions subsys/fs/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -791,9 +791,6 @@ int fs_unmount(struct fs_mount_t *mp)
goto unmount_err;
}

/* clear file system interface */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that this fixes problem with NULL pointer exception but unfortunately now systems continue write to system that is no longer valid.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my testing the i/o errors out and returns an error code, which is a huge improvement over the NULL pointer exception.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the "Fixes #73501" from commit and description as this does not fix the problem, it only makes it manifest in a less violent way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it does fix "the problem", which is NULL pointer dereference caused by a user removing a usb drive during file i/o.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@de-nordic Please check #78018 as an alternative.

mp->fs = NULL;

/* remove mount node from the list */
sys_dlist_remove(&mp->node);
LOG_DBG("fs unmounted from %s", mp->mnt_point);
Expand Down
Loading