Bug 1062674 - Write is failing on a cifs mount with samba-4.1.3-2.fc20 + glusterfs samba vfs plugin
Summary: Write is failing on a cifs mount with samba-4.1.3-2.fc20 + glusterfs samba vf...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: GlusterFS
Classification: Community
Component: gluster-smb
Version: 3.4.2
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: ---
Assignee: Ira Cooper
QA Contact: Lalatendu Mohanty
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-07 16:46 UTC by Lalatendu Mohanty
Modified: 2014-02-24 15:31 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-02-10 11:13:52 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Lalatendu Mohanty 2014-02-07 16:46:55 UTC
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

Comment 1 Lalatendu Mohanty 2014-02-10 11:13:52 UTC
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

Comment 2 Lalatendu Mohanty 2014-02-10 11:15:35 UTC
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


Note You need to log in before you can comment on or make changes to this bug.