Description of problem: Any write on a cifs mount with glusterfs vfs plugin + Samba 4.1.3-2.fc20 is failing with a error "Device or resource busy". However it is creating a empty file if the operation involves creating a file and writing in to it. I have used glusterfs , samba, samba-vfs-glusterfs, default version which comes with updated Fedora 20. Version-Release number of selected component (if applicable): rpm -qa | grep samba samba-client-4.1.3-2.fc20.x86_64 samba-4.1.3-2.fc20.x86_64 samba-vfs-glusterfs-4.1.3-2.fc20.x86_64 samba-libs-4.1.3-2.fc20.x86_64 samba-common-4.1.3-2.fc20.x86_64 rpm -qa | grep gluster glusterfs-libs-3.4.2-1.fc20.x86_64 glusterfs-api-3.4.2-1.fc20.x86_64 glusterfs-3.4.2-1.fc20.x86_64 glusterfs-cli-3.4.2-1.fc20.x86_64 glusterfs-server-3.4.2-1.fc20.x86_64 samba-vfs-glusterfs-4.1.3-2.fc20.x86_64 glusterfs-devel-3.4.2-1.fc20.x86_64 glusterfs-fuse-3.4.2-1.fc20.x86_64 glusterfs-api-devel-3.4.2-1.fc20.x86_64 How reproducible: Always Steps to Reproduce: 1. Create a volume 2. Mount the volume using cifs 3. do some write IO Actual results: On mount point: echo "hello" > smbfile -bash: smbfile: Device or resource busy Expected results: Additional info: In /var/log/samba: [2014/02/07 11:12:22.421175, 0] ../source3/modules/vfs_glusterfs.c:284(vfs_gluster_connect) testvol: Initialized volume from server localhost [2014/02/07 11:12:33.244678, 0] ../source3/modules/vfs_glusterfs.c:652(vfs_gluster_lstat) glfs_lstat(./..) failed: No data available [2014/02/07 11:12:36.427898, 0] ../source3/modules/vfs_glusterfs.c:652(vfs_gluster_lstat) glfs_lstat(./..) failed: No data available [2014/02/07 11:12:36.436113, 0] ../source3/modules/vfs_glusterfs.c:652(vfs_gluster_lstat) glfs_lstat(./..) failed: No data available [2014/02/07 11:12:36.447056, 0] ../source3/modules/vfs_glusterfs.c:652(vfs_gluster_lstat) glfs_lstat(./..) failed: No data available smb.conf settings ################ testparm -s Load smb config files from /etc/samba/smb.conf rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384) Processing section "[homes]" Processing section "[printers]" Processing section "[testvol]" Loaded services file OK. Server role: ROLE_STANDALONE [global] workgroup = MYGROUP server string = Samba Server Version %v log file = /var/log/samba/log.%m max log size = 50 idmap config * : backend = tdb cups options = raw [homes] comment = Home Directories read only = No browseable = No [printers] comment = All Printers path = /var/spool/samba printable = Yes print ok = Yes browseable = No [testvol] comment = For samba share of volume smb-vol-2 path = / read only = No guest ok = Yes vfs objects = glusterfs glusterfs:loglevel = 10 glusterfs:logfile = /var/log/samba/glusterfs-smb-vol-2.%M.log glusterfs:volume = testvol
It seems i saw the issue because of below function. ( in upstream Samba code, source3/modules/vfs_glusterfs.c) static int vfs_gluster_kernel_flock(struct vfs_handle_struct *handle, files_struct *fsp, uint32 share_mode, uint32_t access_mask) { errno = ENOSYS; return -1; } vfs_gluster_kernel_flock returns -1 as GlusterFS does not support kernel_flock_fn of Samba After using "kernel share modes = No" for the share (in smb.conf), write seems work fine. [testvol] comment = For samba share of volume smb-vol-2 path = / read only = No guest ok = Yes kernel share modes = No vfs objects = glusterfs glusterfs:loglevel = 10 glusterfs:logfile = /var/log/samba/glusterfs-smb-vol-2.%M.log glusterfs:volume = testvol
Below email thread in Samba technical have same point as mentioned above during the code review of GlusterFS vfs plugin for Samba. https://groups.google.com/forum/#!topic/mailing.unix.samba-technical/F5410XINM1U