Skip to content

fix: drop user.openvfs.data written by processes other than the desktop client - #49

Open
flash7777 wants to merge 1 commit into
opencloud-eu:mainfrom
flash7777:feature/strip-xattr-keys
Open

flash7777 wants to merge 1 commit into
opencloud-eu:mainfrom
flash7777:feature/strip-xattr-keys

Conversation

@flash7777

@flash7777 flash7777 commented Jul 1, 2026 •

Copy link
Copy Markdown

Problem

File managers (Nautilus, Dolphin) copy all user.* xattrs on copy and paste. A copied user.openvfs.data carries the fileid and state of the original, so the copy looks like the same file to the sync client.

Solution

Once a desktop client is registered (VERSION handshake), a setxattr of user.openvfs.data from any other process removes the entry instead of writing it and returns success. The client sets the data again for files inside the sync root. Without a registered client the behaviour is unchanged.

The earlier -x option for filtering single keys is gone, as suggested in the review.

Test

  • unit tests pass
  • functional test with a fake client over the socket API and cp --preserve=xattr inside the mount:
    • foreign setfattr of user.openvfs.data is dropped, the client's own write is kept
    • the copy no longer inherits the fileid
    • without a registered client, foreign writes and copies behave as before
  • same test against current main: the copy inherits the fileid

@dragotin

dragotin commented Jul 2, 2026

Copy link
Copy Markdown
Member

Thanks a lot for you PR, good catch.

What I do not get completely: When the external applications such as nautilus copies the xattrs, why should we not completely remove the user xattrs of openvfs? Why do you want to filter for certain members?

Can you elaborate? Thanks.

@dragotin

dragotin commented Jul 6, 2026

Copy link
Copy Markdown
Member

Thanks for updating the PR, but I am still not convinced, I still think you should remove the entire openVFS metadata that are inconsistent. The syncing application should, if the resource is still within a sync dir, set the data new anyway next moment.

User Metadata should not be part of the openVFS Namespace anyway. That is why we put our metadata into a JSON document instead into single values.

…op client

File managers copy all user.* xattrs on copy and paste, so a copied file
inherited the fileid and state of the original. Once a desktop client is
registered, a setxattr of user.openvfs.data from any other process now
removes the entry instead of writing it. The client sets it again for
files inside the sync root.
@flash7777
flash7777 force-pushed the feature/strip-xattr-keys branch from 8e45db7 to c6eef91 Compare October 26, 2026 17:57
@flash7777 flash7777 changed the title feat: add -x flag to strip xattr keys on non-client setxattr fix: drop user.openvfs.data written by processes other than the desktop client Oct 26, 2026
@flash7777

Copy link
Copy Markdown
Author

You're right — I re-checked our sync client, and it writes its placeholder data directly anyway, so there's no case where a partial copy of user.openvfs.data is useful. I reworked the PR: once a desktop client is registered, a setxattr of user.openvfs.data from any other process now removes the entry instead of writing it, and the -x option is gone. Rebased on current main.

Tested with a fake client over the socket API and cp --preserve=xattr: the copy no longer inherits the fileid, without a registered client the behaviour is unchanged.

@dragotin dragotin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I like it now.

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 this pull request may close these issues.

2 participants