← index #15781PR #3443
Related · high · value 7.578
QUERY · ISSUE

extmod/vfs_fat.c still uses _FS_REENTRANT, but lib/oofatfs now uses FF_FS_REENTRANT

openby dhalbertopened 2024-09-03updated 2024-09-03
bug

Port, board and/or hardware

anything using vfs_fat.c

MicroPython version

v1.23 and more recent

Reproduction

extmod/vfs_fat.c still has a couple of #if _FS_REENTRANT, but all the code in lib/oofatfs/ switched to FF_FS_REENTRANT years ago. So I think this was an edit that should have been made but was not.

We noticed this when merging MicroPython into CircuitPython during the last couple of merges.

Expected behaviour

Observed behaviour

Additional Information

No, I've provided everything above.

Code of Conduct

Yes, I agree

CANDIDATE · PULL REQUEST

extmod/vfs_fat: Mount FatFS on creation so VFS methods can be used.

mergedby dpgeorgeopened 2017-11-16updated 2017-11-20

It's possible to use the methods (eg ilistdir) of a VFS FatFS object
without it being mounted in the VFS itself. This previously worked but
only because FatFS was "mounting" the filesystem automatically when any
function (eg f_opendir) was called. But it didn't work for ports that used
synchronisation objects (_FS_REENTRANT) because they are only initialised
via a call to f_mount. So, call f_mount explicitly when creating a new
FatFS object so that everything is set up correctly. Then also provide a
finaliser to do the f_umount call, but only if synchronisation objects are
enabled (since otherwise the f_umount call does nothing).

Should fix #3424.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied