Skip to content
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

Bugs in the extended attributes mechanism #24

Open
paulwedeck opened this issue Oct 11, 2023 · 0 comments · May be fixed by #25
Open

Bugs in the extended attributes mechanism #24

paulwedeck opened this issue Oct 11, 2023 · 0 comments · May be fixed by #25

Comments

@paulwedeck
Copy link

Hello,
I discovered multiple questionable to bugged code places in xattr.c:

  • If a directory gets the file_type flag due to its content, the flag is only visible if a listxattr has been executed before the getxattr call.
  • An implicit file_type flag set by listxattr or getxattr persists even if the condition is no longer true. This even happens if the file system is mounted as read-only.
  • The setxattr handler does not use a transaction for its data. Therefore, crash states are possible where the parent directory has an implicit flag but the file doesn't and vice versa.
  • For some crash states, getxattr even fails.

Further, pmfs_new_data_blocks sets the huge_aligned_file flag even if this part of the inode is not part of them transaction.
Therefore, crash states are possible where the overall operation succeeded but the flag (and therefore the implicit) attribute is not set and vice versa.
While inspecting the code, I could only prove that it was necessary for the fallocate syscall to include the whole inode in the transaction.
I assume that there are more places but I have not yet found them.

@paulwedeck paulwedeck linked a pull request Oct 11, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant