{"action":"created","comment":{"url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/comments/170058998","pull_request_review_id":98687610,"id":170058998,"diff_hunk":"@@ -35,39 +35,27 @@\n static int fat_error_remap(FRESULT res)\n {\n     switch(res) {\n-        case FR_OK:                     /* (0) Succeeded */\n-            return 0;                   /* no error */\n-        case FR_DISK_ERR:               /* (1) A hard error occurred in the low level disk I/O layer */\n-        case FR_NOT_READY:              /* (3) The physical drive cannot work */\n-            return -EIO;                /* I/O error */\n-        case FR_NO_FILE:                /* (4) Could not find the file */\n-        case FR_NO_PATH:                /* (5) Could not find the path */\n-        case FR_INVALID_NAME:           /* (6) The path name format is invalid */\n-        case FR_INVALID_DRIVE:          /* (11) The logical drive number is invalid */\n-        case FR_NO_FILESYSTEM:          /* (13) There is no valid FAT volume */\n-            return -ENOENT;             /* No such file or directory */\n-        case FR_DENIED:                 /* (7) Access denied due to prohibited access or directory full */\n-            return -EACCES;             /* Permission denied */\n-        case FR_EXIST:                  /* (8) Access denied due to prohibited access */\n-            return -EEXIST;             /* File exists */\n-        case FR_WRITE_PROTECTED:        /* (10) The physical drive is write protected */\n-        case FR_LOCKED:                 /* (16) The operation is rejected according to the file sharing policy */\n-            return -EACCES;             /* Permission denied */\n-        case FR_INVALID_OBJECT:         /* (9) The file/directory object is invalid */\n-            return -EFAULT;             /* Bad address */\n-        case FR_NOT_ENABLED:            /* (12) The volume has no work area */\n-            return -ENXIO;              /* No such device or address */\n-        case FR_NOT_ENOUGH_CORE:        /* (17) LFN working buffer could not be allocated */\n-            return -ENOMEM;             /* Not enough space */\n-        case FR_TOO_MANY_OPEN_FILES:    /* (18) Number of open files > _FS_LOCK */\n-            return -ENFILE;             /* Too many open files in system */\n-        case FR_INVALID_PARAMETER:      /* (19) Given parameter is invalid */\n-            return -ENOEXEC;            /* Exec format error */\n-        case FR_INT_ERR:                /* (2) Assertion failed */\n-        case FR_MKFS_ABORTED:           /* (14) The f_mkfs() aborted due to any parameter error */\n-        case FR_TIMEOUT:                /* (15) Could not get a grant to access the volume within defined period */\n-        default:                        /* Bad file number */\n-            return -EBADF;\n+        case FR_OK:                   return 0;           // (0) Succeeded","path":"features/filesystem/fat/FATFileSystem.cpp","position":37,"original_position":37,"commit_id":"b548fd8a39381ab20dfc3198444e0b4da9e80179","original_commit_id":"b548fd8a39381ab20dfc3198444e0b4da9e80179","user":{"login":"geky","id":1075160,"avatar_url":"https://avatars3.githubusercontent.com/u/1075160?v=4","gravatar_id":"","url":"https://api.github.com/users/geky","html_url":"https://github.com/geky","followers_url":"https://api.github.com/users/geky/followers","following_url":"https://api.github.com/users/geky/following{/other_user}","gists_url":"https://api.github.com/users/geky/gists{/gist_id}","starred_url":"https://api.github.com/users/geky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geky/subscriptions","organizations_url":"https://api.github.com/users/geky/orgs","repos_url":"https://api.github.com/users/geky/repos","events_url":"https://api.github.com/users/geky/events{/privacy}","received_events_url":"https://api.github.com/users/geky/received_events","type":"User","site_admin":false},"body":"@0xc0170, https://github.com/ARMmbed/mbed-os/pull/6014 will update this anyways won't it?","created_at":"2018-02-22T19:00:00Z","updated_at":"2018-02-22T19:00:00Z","html_url":"https://github.com/ARMmbed/mbed-os/pull/6120#discussion_r170058998","pull_request_url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/6120","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/comments/170058998"},"html":{"href":"https://github.com/ARMmbed/mbed-os/pull/6120#discussion_r170058998"},"pull_request":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/6120"}},"in_reply_to_id":169593696},"pull_request":{"url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/6120","id":169694590,"html_url":"https://github.com/ARMmbed/mbed-os/pull/6120","diff_url":"https://github.com/ARMmbed/mbed-os/pull/6120.diff","patch_url":"https://github.com/ARMmbed/mbed-os/pull/6120.patch","issue_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/6120","number":6120,"state":"open","locked":false,"title":"fatfs: Update error code mapping","user":{"login":"geky","id":1075160,"avatar_url":"https://avatars3.githubusercontent.com/u/1075160?v=4","gravatar_id":"","url":"https://api.github.com/users/geky","html_url":"https://github.com/geky","followers_url":"https://api.github.com/users/geky/followers","following_url":"https://api.github.com/users/geky/following{/other_user}","gists_url":"https://api.github.com/users/geky/gists{/gist_id}","starred_url":"https://api.github.com/users/geky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geky/subscriptions","organizations_url":"https://api.github.com/users/geky/orgs","repos_url":"https://api.github.com/users/geky/repos","events_url":"https://api.github.com/users/geky/events{/privacy}","received_events_url":"https://api.github.com/users/geky/received_events","type":"User","site_admin":false},"body":"This is in response to https://github.com/ARMmbed/mbed-os/issues/6072\r\n\r\nA lot of the error codes in fatfs were mapped incorrectly. This patch revisits the error code mapping to try to correct these mistakes. I'm open to feedback on these.\r\n\r\n| ChanFS                  | was        | should be  | ChanFS description                                               |\r\n| ----------------------- | ---------- | ---------- | ---------------------------------------------------------------- |\r\n| FR_OK                   | 0          | 0          | Succeeded                                                        |\r\n| FR_DISK_ERR             | EIO        | EIO        | A hard error occurred in the low level disk I/O layer            |\r\n| FR_INT_ERR              | ~EBADF~    | -1         | Assertion failed                                                 |\r\n| FR_NOT_READY            | EIO        | EIO        | The physical drive cannot work                                   |\r\n| FR_NO_FILE              | ENOENT     | ENOENT     | Could not find the file                                          |\r\n| FR_NO_PATH              | ~ENOENT~   | ENOTDIR    | Could not find the path                                          |\r\n| FR_INVALID_NAME         | ~ENOENT~   | EINVAL     | The path name format is invalid                                  |\r\n| FR_DENIED               | EACCES     | EACCES     | Access denied due to prohibited access or directory full         |\r\n| FR_EXIST                | EEXIST     | EEXIST     | Access denied due to prohibited access                           |\r\n| FR_INVALID_OBJECT       | ~EFAULT~   | EBADF      | The file/directory object is invalid                             |\r\n| FR_WRITE_PROTECTED      | EACCES     | EACCES     | The physical drive is write protected                            |\r\n| FR_INVALID_DRIVE        | ~ENOENT~   | ENODEV     | The logical drive number is invalid                              |\r\n| FR_NOT_ENABLED          | ~ENXIO~    | ENODEV     | The volume has no work area                                      |\r\n| FR_NO_FILESYSTEM        | ~ENOENT~   | EINVAL     | There is no valid FAT volume                                     |\r\n| FR_MKFS_ABORTED         | ~EBADF~    | EIO        | The f_mkfs() aborted due to any problem                          |\r\n| FR_TIMEOUT              | ~EBADF~    | ETIMEDOUT     | Could not get a grant to access the volume within defined period |\r\n| FR_LOCKED               | ~EACCES~   | EBUSY      | The operation is rejected according to the file sharing policy   |\r\n| FR_NOT_ENOUGH_CORE      | ENOMEM     | ENOMEM     | LFN working buffer could not be allocated                        |\r\n| FR_TOO_MANY_OPEN_FILES  | ENFILE     | ENFILE     | Number of open files > FF_FS_LOCK                                |\r\n| FR_INVALID_PARAMETER    | ~ENOEXEC~  | EINVAL     | Given parameter is invalid                                       |\r\n\r\ncc @kegilbert, @deepikabhavnani \r\nshould resolve https://github.com/ARMmbed/mbed-os/issues/6072\r\nnote, https://github.com/ARMmbed/mbed-os/issues/5653 is related but not fixed by this pr (requires changes in ChanFS).","created_at":"2018-02-16T18:30:12Z","updated_at":"2018-02-22T19:00:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4c4c2d09db00309054ab1fd8a7b666dfd7e064b4","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":144902129,"url":"https://api.github.com/repos/ARMmbed/mbed-os/labels/needs:%20work","name":"needs: work","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/6120/commits","review_comments_url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/6120/comments","review_comment_url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/6120/comments","statuses_url":"https://api.github.com/repos/ARMmbed/mbed-os/statuses/b548fd8a39381ab20dfc3198444e0b4da9e80179","head":{"label":"ARMmbed:g-fat-errors","ref":"g-fat-errors","sha":"b548fd8a39381ab20dfc3198444e0b4da9e80179","user":{"login":"ARMmbed","id":8916057,"avatar_url":"https://avatars3.githubusercontent.com/u/8916057?v=4","gravatar_id":"","url":"https://api.github.com/users/ARMmbed","html_url":"https://github.com/ARMmbed","followers_url":"https://api.github.com/users/ARMmbed/followers","following_url":"https://api.github.com/users/ARMmbed/following{/other_user}","gists_url":"https://api.github.com/users/ARMmbed/gists{/gist_id}","starred_url":"https://api.github.com/users/ARMmbed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARMmbed/subscriptions","organizations_url":"https://api.github.com/users/ARMmbed/orgs","repos_url":"https://api.github.com/users/ARMmbed/repos","events_url":"https://api.github.com/users/ARMmbed/events{/privacy}","received_events_url":"https://api.github.com/users/ARMmbed/received_events","type":"Organization","site_admin":false},"repo":{"id":8270972,"name":"mbed-os","full_name":"ARMmbed/mbed-os","owner":{"login":"ARMmbed","id":8916057,"avatar_url":"https://avatars3.githubusercontent.com/u/8916057?v=4","gravatar_id":"","url":"https://api.github.com/users/ARMmbed","html_url":"https://github.com/ARMmbed","followers_url":"https://api.github.com/users/ARMmbed/followers","following_url":"https://api.github.com/users/ARMmbed/following{/other_user}","gists_url":"https://api.github.com/users/ARMmbed/gists{/gist_id}","starred_url":"https://api.github.com/users/ARMmbed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARMmbed/subscriptions","organizations_url":"https://api.github.com/users/ARMmbed/orgs","repos_url":"https://api.github.com/users/ARMmbed/repos","events_url":"https://api.github.com/users/ARMmbed/events{/privacy}","received_events_url":"https://api.github.com/users/ARMmbed/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ARMmbed/mbed-os","description":"ARM Mbed OS is a platform operating system designed for the internet of things","fork":false,"url":"https://api.github.com/repos/ARMmbed/mbed-os","forks_url":"https://api.github.com/repos/ARMmbed/mbed-os/forks","keys_url":"https://api.github.com/repos/ARMmbed/mbed-os/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ARMmbed/mbed-os/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ARMmbed/mbed-os/teams","hooks_url":"https://api.github.com/repos/ARMmbed/mbed-os/hooks","issue_events_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/events{/number}","events_url":"https://api.github.com/repos/ARMmbed/mbed-os/events","assignees_url":"https://api.github.com/repos/ARMmbed/mbed-os/assignees{/user}","branches_url":"https://api.github.com/repos/ARMmbed/mbed-os/branches{/branch}","tags_url":"https://api.github.com/repos/ARMmbed/mbed-os/tags","blobs_url":"https://api.github.com/repos/ARMmbed/mbed-os/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ARMmbed/mbed-os/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ARMmbed/mbed-os/git/refs{/sha}","trees_url":"https://api.github.com/repos/ARMmbed/mbed-os/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ARMmbed/mbed-os/statuses/{sha}","languages_url":"https://api.github.com/repos/ARMmbed/mbed-os/languages","stargazers_url":"https://api.github.com/repos/ARMmbed/mbed-os/stargazers","contributors_url":"https://api.github.com/repos/ARMmbed/mbed-os/contributors","subscribers_url":"https://api.github.com/repos/ARMmbed/mbed-os/subscribers","subscription_url":"https://api.github.com/repos/ARMmbed/mbed-os/subscription","commits_url":"https://api.github.com/repos/ARMmbed/mbed-os/commits{/sha}","git_commits_url":"https://api.github.com/repos/ARMmbed/mbed-os/git/commits{/sha}","comments_url":"https://api.github.com/repos/ARMmbed/mbed-os/comments{/number}","issue_comment_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/comments{/number}","contents_url":"https://api.github.com/repos/ARMmbed/mbed-os/contents/{+path}","compare_url":"https://api.github.com/repos/ARMmbed/mbed-os/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ARMmbed/mbed-os/merges","archive_url":"https://api.github.com/repos/ARMmbed/mbed-os/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ARMmbed/mbed-os/downloads","issues_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues{/number}","pulls_url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls{/number}","milestones_url":"https://api.github.com/repos/ARMmbed/mbed-os/milestones{/number}","notifications_url":"https://api.github.com/repos/ARMmbed/mbed-os/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ARMmbed/mbed-os/labels{/name}","releases_url":"https://api.github.com/repos/ARMmbed/mbed-os/releases{/id}","deployments_url":"https://api.github.com/repos/ARMmbed/mbed-os/deployments","created_at":"2013-02-18T15:23:11Z","updated_at":"2018-02-21T10:52:59Z","pushed_at":"2018-02-22T17:41:46Z","git_url":"git://github.com/ARMmbed/mbed-os.git","ssh_url":"git@github.com:ARMmbed/mbed-os.git","clone_url":"https://github.com/ARMmbed/mbed-os.git","svn_url":"https://github.com/ARMmbed/mbed-os","homepage":"https://mbed.com","size":195524,"stargazers_count":1507,"watchers_count":1507,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1338,"mirror_url":null,"archived":false,"open_issues_count":380,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":1338,"open_issues":380,"watchers":1507,"default_branch":"master"}},"base":{"label":"ARMmbed:master","ref":"master","sha":"ff41a1065878cf924978803706c4fb2d5fcf7c7e","user":{"login":"ARMmbed","id":8916057,"avatar_url":"https://avatars3.githubusercontent.com/u/8916057?v=4","gravatar_id":"","url":"https://api.github.com/users/ARMmbed","html_url":"https://github.com/ARMmbed","followers_url":"https://api.github.com/users/ARMmbed/followers","following_url":"https://api.github.com/users/ARMmbed/following{/other_user}","gists_url":"https://api.github.com/users/ARMmbed/gists{/gist_id}","starred_url":"https://api.github.com/users/ARMmbed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARMmbed/subscriptions","organizations_url":"https://api.github.com/users/ARMmbed/orgs","repos_url":"https://api.github.com/users/ARMmbed/repos","events_url":"https://api.github.com/users/ARMmbed/events{/privacy}","received_events_url":"https://api.github.com/users/ARMmbed/received_events","type":"Organization","site_admin":false},"repo":{"id":8270972,"name":"mbed-os","full_name":"ARMmbed/mbed-os","owner":{"login":"ARMmbed","id":8916057,"avatar_url":"https://avatars3.githubusercontent.com/u/8916057?v=4","gravatar_id":"","url":"https://api.github.com/users/ARMmbed","html_url":"https://github.com/ARMmbed","followers_url":"https://api.github.com/users/ARMmbed/followers","following_url":"https://api.github.com/users/ARMmbed/following{/other_user}","gists_url":"https://api.github.com/users/ARMmbed/gists{/gist_id}","starred_url":"https://api.github.com/users/ARMmbed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARMmbed/subscriptions","organizations_url":"https://api.github.com/users/ARMmbed/orgs","repos_url":"https://api.github.com/users/ARMmbed/repos","events_url":"https://api.github.com/users/ARMmbed/events{/privacy}","received_events_url":"https://api.github.com/users/ARMmbed/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ARMmbed/mbed-os","description":"ARM Mbed OS is a platform operating system designed for the internet of things","fork":false,"url":"https://api.github.com/repos/ARMmbed/mbed-os","forks_url":"https://api.github.com/repos/ARMmbed/mbed-os/forks","keys_url":"https://api.github.com/repos/ARMmbed/mbed-os/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ARMmbed/mbed-os/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ARMmbed/mbed-os/teams","hooks_url":"https://api.github.com/repos/ARMmbed/mbed-os/hooks","issue_events_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/events{/number}","events_url":"https://api.github.com/repos/ARMmbed/mbed-os/events","assignees_url":"https://api.github.com/repos/ARMmbed/mbed-os/assignees{/user}","branches_url":"https://api.github.com/repos/ARMmbed/mbed-os/branches{/branch}","tags_url":"https://api.github.com/repos/ARMmbed/mbed-os/tags","blobs_url":"https://api.github.com/repos/ARMmbed/mbed-os/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ARMmbed/mbed-os/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ARMmbed/mbed-os/git/refs{/sha}","trees_url":"https://api.github.com/repos/ARMmbed/mbed-os/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ARMmbed/mbed-os/statuses/{sha}","languages_url":"https://api.github.com/repos/ARMmbed/mbed-os/languages","stargazers_url":"https://api.github.com/repos/ARMmbed/mbed-os/stargazers","contributors_url":"https://api.github.com/repos/ARMmbed/mbed-os/contributors","subscribers_url":"https://api.github.com/repos/ARMmbed/mbed-os/subscribers","subscription_url":"https://api.github.com/repos/ARMmbed/mbed-os/subscription","commits_url":"https://api.github.com/repos/ARMmbed/mbed-os/commits{/sha}","git_commits_url":"https://api.github.com/repos/ARMmbed/mbed-os/git/commits{/sha}","comments_url":"https://api.github.com/repos/ARMmbed/mbed-os/comments{/number}","issue_comment_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/comments{/number}","contents_url":"https://api.github.com/repos/ARMmbed/mbed-os/contents/{+path}","compare_url":"https://api.github.com/repos/ARMmbed/mbed-os/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ARMmbed/mbed-os/merges","archive_url":"https://api.github.com/repos/ARMmbed/mbed-os/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ARMmbed/mbed-os/downloads","issues_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues{/number}","pulls_url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls{/number}","milestones_url":"https://api.github.com/repos/ARMmbed/mbed-os/milestones{/number}","notifications_url":"https://api.github.com/repos/ARMmbed/mbed-os/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ARMmbed/mbed-os/labels{/name}","releases_url":"https://api.github.com/repos/ARMmbed/mbed-os/releases{/id}","deployments_url":"https://api.github.com/repos/ARMmbed/mbed-os/deployments","created_at":"2013-02-18T15:23:11Z","updated_at":"2018-02-21T10:52:59Z","pushed_at":"2018-02-22T17:41:46Z","git_url":"git://github.com/ARMmbed/mbed-os.git","ssh_url":"git@github.com:ARMmbed/mbed-os.git","clone_url":"https://github.com/ARMmbed/mbed-os.git","svn_url":"https://github.com/ARMmbed/mbed-os","homepage":"https://mbed.com","size":195524,"stargazers_count":1507,"watchers_count":1507,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1338,"mirror_url":null,"archived":false,"open_issues_count":380,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":1338,"open_issues":380,"watchers":1507,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/6120"},"html":{"href":"https://github.com/ARMmbed/mbed-os/pull/6120"},"issue":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/issues/6120"},"comments":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/issues/6120/comments"},"review_comments":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/6120/comments"},"review_comment":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/6120/commits"},"statuses":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/statuses/b548fd8a39381ab20dfc3198444e0b4da9e80179"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"geky"}}