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

ignore when listxattr fails with ENODATA #2350

Merged
merged 1 commit into from Aug 13, 2018

Conversation

symphorien
Copy link
Member

This happens on CIFS and means the remote filesystem has no extended
attributes (if I understand correctly).

This happens on CIFS and means the remote filesystem has no extended
attributes.
@edolstra edolstra merged commit 746cf2d into NixOS:master Aug 13, 2018
@dezgeg
Copy link
Contributor

dezgeg commented Aug 14, 2018

Hm, sounds like a bug in CIFS - it should return 0 if there are no xattrs.

@symphorien
Copy link
Member Author

I looked superficially in the code, the ENODATA seems to come from here https://elixir.bootlin.com/linux/latest/source/fs/cifs/smb2maperror.c#L380
So the error means "the remote fs has xattrs disabled" not that this particuliar file has no xattr. So this is approximately ENOTSUP.

@dezgeg
Copy link
Contributor

dezgeg commented Aug 14, 2018

Here they explicitly try to map -ENODATA for listxattr() to returning 0: https://elixir.bootlin.com/linux/latest/source/fs/cifs/smb2ops.c#L794

	/*
	 * If ea_name is NULL (listxattr) and there are no EAs, return 0 as it's
	 * not an error. Otherwise, the specified ea_name was not found.
	 */
	if (!rc)
		rc = move_smb2_ea_to_cifs(ea_data, buf_size, smb2_data,
					  SMB2_MAX_EA_BUF, ea_name);
	else if (!ea_name && rc == -ENODATA)
		rc = 0;

But something is clearly going wrong.

@dezgeg
Copy link
Contributor

dezgeg commented Aug 14, 2018

Ah, it's only very recently fixed - only in v4.18: torvalds/linux@ae2cd7f. Mystery solved then. Let's still keep the -ENODATA check so that older kernels still work, it doesn't cost us anything.

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.

None yet

3 participants