Skip to content

littlefs: Fix issue updating dir struct when extended dir chain #6338

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

Merged
merged 1 commit into from
Mar 20, 2018

Conversation

geky
Copy link
Contributor

@geky geky commented Mar 12, 2018

Description

Like most of the lfs_dir_t functions, lfs_dir_append is responsible for updating the lfs_dir_t struct if the underlying directory block is moved. This property makes handling worn out blocks much easier by removing the amount of state that needs to be considered during a directory update.

However, extending the dir chain is a bit of a corner case. It's not changing the old block, but callers of lfs_dir_append do assume the "entry" will reside in "dir" after lfs_dir_append completes.

This issue only occurs when creating files, since mkdir does not use the entry after lfs_dir_append. Unfortunately, the tests against extending the directory chain were all made using mkdir.

cc @deepikabhavnani, @kegilbert
intended for patch

Pull request type

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

Like most of the lfs_dir_t functions, lfs_dir_append is responsible for
updating the lfs_dir_t struct if the underlying directory block is
moved. This property makes handling worn out blocks much easier by
removing the amount of state that needs to be considered during a
directory update.

However, extending the dir chain is a bit of a corner case. It's not
changing the old block, but callers of lfs_dir_append do assume the
"entry" will reside in "dir" after lfs_dir_append completes.

This issue only occurs when creating files, since mkdir does not use
the entry after lfs_dir_append. Unfortunately, the tests against
extending the directory chain were all made using mkdir.

Found by schouleu
Copy link

@deepikabhavnani deepikabhavnani left a comment

Choose a reason for hiding this comment

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

Looks good to me

@cmonr
Copy link
Contributor

cmonr commented Mar 15, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Mar 15, 2018

Build : FAILURE

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

@cmonr
Copy link
Contributor

cmonr commented Mar 16, 2018

CI issue: ARM network licenses could not be checked out during build.

Restarting.
/morph build

@mbed-ci
Copy link

mbed-ci commented Mar 16, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci
Copy link

mbed-ci commented Mar 17, 2018

@mbed-ci
Copy link

mbed-ci commented Mar 17, 2018

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 19, 2018

/morph test

@mbed-ci
Copy link

mbed-ci commented Mar 20, 2018

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

Successfully merging this pull request may close these issues.

6 participants