[f2fs] Fix tracking i_pino during inline directory rename

Previously, inline directory rename causes i_pino inconsistency.
In the case of the following scenario, a bug can occur.

Let's suppose there are three directories, "/a", "/b", and "/a/c".
- pino of "/a/c" is DIR_A_INO.

Then,
1. Rename "/a/c" to "/b/c"
2. Remount
The parent inode number of "/b/c" should be DIR_B_INO, but it is still DIR_A_INO.

It is because Dir::Rename has old_dir_page(the page having ".." dentry of target directory) and ipage(the inode page of target directory) simultaneously.
Once Dir::Rename is called, it updates i_pino of ipage and flushes it.
Then, it updates ".." dentry of old_dir_page and flushes it.
When target directory supports inline directory entry, old_dir_page becomes same to inode page.
So, old_dir_page overwrites i_pino information of inode page and rolls back to the previous parent inode number.

To fix it, i_pino is updated only in vnode, and updated to the page later.

Change-Id: Id82a36e3188954a1e6307920ad096cad386dd9df
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/613550
Commit-Queue: Chris Suter <csuter@google.com>
Reviewed-by: Chris Suter <csuter@google.com>
4 files changed
tree: d9668b52f858360de531c82ecd00a3870eb78a4b
  1. boards/
  2. build/
  3. bundles/
  4. docs/
  5. examples/
  6. garnet/
  7. products/
  8. scripts/
  9. sdk/
  10. src/
  11. third_party/
  12. tools/
  13. zircon/
  14. .clang-format
  15. .clang-tidy
  16. .git-blame-ignore-revs
  17. .gitattributes
  18. .gitignore
  19. .gn
  20. .style.yapf
  21. analysis_options.yaml
  22. AUTHORS
  23. BUILD.gn
  24. CODE_OF_CONDUCT.md
  25. CONTRIBUTING.md
  26. LICENSE
  27. OWNERS
  28. PATENTS
  29. pyrightconfig.json
  30. README.md
  31. rustfmt.toml
README.md

Fuchsia

What is Fuchsia?

Fuchsia an open source, general purpose operating system supporting modern 64-bit Intel and ARM processors.

We expect everyone interacting with our project to respect our code of conduct.

Read more about Fuchsia's principles.

How can I build and run Fuchsia?

See Getting Started.

Where can I learn more about Fuchsia?

See fuchsia.dev.