Bug 4670 - Cannot write xattr over CIFS
Summary: Cannot write xattr over CIFS
Status: RESOLVED DUPLICATE of bug 6506
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: File Services (show other bugs)
Version: 3.0.28
Hardware: All Linux
: P3 normal
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact:
Depends on:
Reported: 2007-05-30 06:14 UTC by James Le Cuirot
Modified: 2009-09-17 15:35 UTC (History)
2 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description James Le Cuirot 2007-05-30 06:14:03 UTC
I'm trying to prove a point to a colleague of mine over how we're going to set up our network but things aren't going too well. I need to use extended attributes over CIFS. I can list them and read them but writing is simply not working.

schwartz /SharedDocs # setfattr -n foooo -v baaaar blah
setfattr: blah: Operation not supported
schwartz /SharedDocs # attr -s foooo -V baaaar blah
attr_set: Invalid argument
Could not set "foooo" for blah

I first encountered this on 3.0.24. I saw "BUG 4599: Fix failure when setting attributes" in the fixes list for 3.0.25a so I tried that but it still doesn't work. I've tried mounting remotely and on the same machine. XFS is the filesystem for both machines. Writing attributes outside of Samba works just fine. I have definitely enabled EA support for CIFS in the kernel. The distribution is Gentoo. Here's my smb.conf.

   server string = Samba Server %v
   hosts allow = 192.168.1., 10.0.2., 127.
   security = share

   comment = Shared Documents
   path = /SharedDocs
   read only = no
   guest only = yes
   ea support = yes
Comment 1 James Le Cuirot 2007-05-30 06:21:27 UTC
Oops I just remembered you have to prepend "user." when using setfattr. The response from that is "Invalid argument" as well.

schwartz /SharedDocs # setfattr -n user.foooo -v baaaar blah
setfattr: blah: Invalid argument
Comment 2 Gerald (Jerry) Carter (dead mail address) 2007-05-30 06:46:37 UTC
I'm assuming you are using the Linux CIFS fs, correct?
Comment 3 James Le Cuirot 2007-05-30 11:45:44 UTC
Yeah sorry, do you maintain that as well? It didn't occur to me that the problem might be there. I mount it like this.

mount.cifs //rhapsody/SharedDocs /SharedDocs -o guest
Comment 4 Gerald (Jerry) Carter (dead mail address) 2007-05-30 12:14:14 UTC
Steve French maintains the CIFS fs code (kernel code and user space tools).
I'll reassign to him.
Comment 5 James Le Cuirot 2007-05-30 16:27:02 UTC
For Steve's information, the kernel version is 2.6.21.
Comment 6 Steve French 2007-07-20 16:29:36 UTC
Note that setting extended attributes over cifs (due to security restrictions on the server) is only supported for a few categories of xattrs.

xattrs are similar to cifs EAs (os/2 and windows extended attributes) and are supported by Samba (with the appropriate smb.conf and mount options) and Windows servers (over NTFS and various file systems) and various other servers.

The Linux client handles "user" category xattrs (xattrs beginning with "user." or synonym "os2.") which are by far the most common.  The Linux cifs client also handles a few special purpose categories of "system." xattrs (e.g. for POSIX ACLs) and is thinking of extending that to include the xattrs for "systeme.dosattr" (for the old dos attributes) and nfsv4 ACL.  Currently there is no server implementation in Samba for supporting other categories of xattrs, although jra and I have defined the network protocol mechanism for it.

What is the category of xattr that you are trying to set?  Are you sure that you can't just do "user.foooo"
Comment 7 James Le Cuirot 2007-07-20 16:59:39 UTC
I am aware of the "user." prefix because that confused me when I first started using xattr. The setfattr command automatically adds it and the attr command adds it as long as you don't specify -R, I believe. I have tried adding it manually anyway and I also tried writing a test program in C. All have the same result. There is something else wrong here.
Comment 8 James Le Cuirot 2007-07-20 17:04:37 UTC
Oh sorry, I was going by what I said in the first comment and forgot about my second comment! I haven't worked with xattr since because we had to use an alternative solution. setfattr does NOT automatically add "user." but as I said, I did try that.
Comment 9 Björn Jacke 2008-01-14 09:01:21 UTC
I think this is not Steve's bug. You can set EAs on a NTFS based share from XP using Linux cifs vfs without a problem. Really looks like a Samba bug.
Comment 10 Björn Jacke 2009-09-17 15:35:33 UTC
this should work with 3.4.1. Just tested it myself.

*** This bug has been marked as a duplicate of bug 6506 ***