New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fatfs: Update error code mapping #6336

Merged
merged 4 commits into from May 22, 2018

Conversation

Projects
None yet
9 participants
@geky
Member

geky commented Mar 12, 2018

Description

Continues #6072, #6120, #6323

A lot of the error codes in fatfs were mapped incorrectly. This patch revisits the error code mapping to try to correct these mistakes.

Note: This is required before we can test LittleFS + FAT consistently

ChanFS was should be ChanFS description
FR_OK 0 0 Succeeded
FR_DISK_ERR EIO EIO A hard error occurred in the low level disk I/O layer
FR_INT_ERR EBADF -1 Assertion failed
FR_NOT_READY EIO EIO The physical drive cannot work
FR_NO_FILE ENOENT ENOENT Could not find the file
FR_NO_PATH ENOENT ENOTDIR Could not find the path
FR_INVALID_NAME ENOENT EINVAL The path name format is invalid
FR_DENIED EACCES EACCES Access denied due to prohibited access or directory full
FR_EXIST EEXIST EEXIST Access denied due to prohibited access
FR_INVALID_OBJECT EFAULT EBADF The file/directory object is invalid
FR_WRITE_PROTECTED EACCES EACCES The physical drive is write protected
FR_INVALID_DRIVE ENOENT ENODEV The logical drive number is invalid
FR_NOT_ENABLED ENXIO ENODEV The volume has no work area
FR_NO_FILESYSTEM ENOENT EINVAL There is no valid FAT volume
FR_MKFS_ABORTED EBADF EIO The f_mkfs() aborted due to any problem
FR_TIMEOUT EBADF ETIMEDOUT Could not get a grant to access the volume within defined period
FR_LOCKED EACCES EBUSY The operation is rejected according to the file sharing policy
FR_NOT_ENOUGH_CORE ENOMEM ENOMEM LFN working buffer could not be allocated
FR_TOO_MANY_OPEN_FILES ENFILE ENFILE Number of open files > FF_FS_LOCK
FR_INVALID_PARAMETER ENOEXEC EINVAL Given parameter is invalid

cc @kegilbert, @deepikabhavnani, @kjbracey-arm, @JanneKiiskila, @teetak01
intended for minor release
should resolve #6072, #5653

Pull request type

  • Fix
  • Refactor
  • New target
  • Feature
  • Breaking change
@cmonr

This comment has been minimized.

Contributor

cmonr commented Mar 21, 2018

/morph build

@cmonr cmonr added needs: CI and removed needs: review labels Mar 21, 2018

@mbed-ci

This comment has been minimized.

mbed-ci commented Mar 21, 2018

Build : SUCCESS

Build number : 1502
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6336/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@0xc0170 0xc0170 added ready for merge and removed needs: CI labels Mar 21, 2018

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Mar 21, 2018

@JanneKiiskila @yogpan01 to be aware for this change

@JanneKiiskila

This comment has been minimized.

Contributor

JanneKiiskila commented Mar 21, 2018

Task IOTCLT-2533 raised to our backog.

@teetak01

This comment has been minimized.

teetak01 commented Mar 21, 2018

I would recommend to keep this PR open until IOTCLT-2533 is done.

@cmonr cmonr added the do not merge label Mar 21, 2018

@cmonr

This comment has been minimized.

Contributor

cmonr commented Mar 21, 2018

Acking the Do Not Merge until the internal ticket is resolved.

@JanneKiiskila

This comment has been minimized.

Contributor

JanneKiiskila commented Apr 18, 2018

This will be resolved in Cloud Client release 1.3.1, which is due any day now.

@geky geky referenced this pull request Apr 29, 2018

Merged

littlefs: Map LFS_ERR_CORRUPT to EILSEQ #6772

1 of 1 task complete

@geky geky dismissed stale reviews from kjbracey-arm, cmonr, and 0xc0170 via 9902a2b Apr 29, 2018

@geky

This comment has been minimized.

Member

geky commented Apr 29, 2018

Ok, now this should fix #5653

Also added a fix for some issues with errno include ordering

@cmonr

This comment has been minimized.

Contributor

cmonr commented May 15, 2018

@geky @JanneKiiskila Is it safe to say that this is now unblocked and can proceed into 5.9?

@geky

This comment has been minimized.

Member

geky commented May 15, 2018

@teetak01, can this be progressed?

@teetak01

This comment has been minimized.

teetak01 commented May 15, 2018

http://github.com/armmbed/mbed-cloud-client-example should be compatible. At least it was working one month ago still. The required fix on Client-side was already part of 1.3.1 release.

geky added some commits Apr 29, 2018

retarget: Added include errno.h
Unfortunately, some toolchains don't define the same errno codes that
are used fairly consistently on Linux based platforms, which means they
also don't match the errno codes used in the retarget layer.

If a user includes errno.h after mbed.h, the errno codes can be
redefined incorrectly.

Adding an include of errno.h in mbed.h forces the order to be fixed.
retarget: Added workaround for conflicting definitions of error_t
The errno.h header file defines the type error_t, unfortunately this
is a common type name that may be defined in user code. For at least GCC
we can work around this by telling errno that the error_t is already
defined.

@geky geky force-pushed the geky:fat-errors branch from dc32a3d to effdc65 May 17, 2018

@geky

This comment has been minimized.

Member

geky commented May 17, 2018

Rebased and added a workaround for the error_t conflict

@cmonr

This comment has been minimized.

Contributor

cmonr commented May 17, 2018

Will restart CI later today. Giving PRs targeted for 5.8.5 a chance to complete.

@adbridge

This comment has been minimized.

Contributor

adbridge commented May 21, 2018

@kjbracey-arm @cmonr @0xc0170 Are you happy with the updates ? Can you please approve if so?

@adbridge adbridge added needs: review and removed needs: work labels May 21, 2018

@cmonr

cmonr approved these changes May 21, 2018

@cmonr

This comment has been minimized.

Contributor

cmonr commented May 21, 2018

My bad. Forgot I was a reviewer ^_^

/morph build

@cmonr cmonr added needs: CI and removed needs: review labels May 21, 2018

@mbed-ci

This comment has been minimized.

mbed-ci commented May 21, 2018

Build : SUCCESS

Build number : 2089
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6336/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@0xc0170

This comment has been minimized.

Member

0xc0170 commented May 22, 2018

I would recommend to keep this PR open until IOTCLT-2533 is done.

@teetak01 I checked and its closed. All good for this PR to be approved?

@0xc0170 0xc0170 added needs: review and removed needs: CI labels May 22, 2018

@0xc0170 0xc0170 requested a review from teetak01 May 22, 2018

@teetak01

should be fine. I only tested the original PR.

@0xc0170 0xc0170 merged commit 02af950 into ARMmbed:master May 22, 2018

13 checks passed

AWS-CI uVisor Build & Test Success
Details
ci-morph-build build completed
Details
ci-morph-exporter build completed
Details
ci-morph-mbed2-build build completed
Details
ci-morph-test test completed
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
travis-ci/astyle Passed, 845 warnings
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/events Passed, runtime is 9974 cycles (+285 cycles)
Details
travis-ci/gitattributestest Local gitattributestest testing has passed
Details
travis-ci/littlefs Passed, code size is 9964B (+0.00%)
Details
travis-ci/tools Local tools testing has passed
Details

@cmonr cmonr removed the ready for merge label May 23, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment