Bug 762090 (GLUSTER-358)

Summary: kernel build fails on samba mount
Product: [Community] GlusterFS Reporter: Raghavendra G <raghavendra>
Component: boosterAssignee: Raghavendra G <raghavendra>
Status: CLOSED DUPLICATE QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: 2.0.7CC: aavati, gluster-bugs
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
dmesg output of cifs module
none
smbd log file
none
gluster logs
none
patchset providing relative path support
none
small program to reproduce the issue none

Description Raghavendra G 2009-11-04 05:34:24 UTC
Created attachment 89 [details]
A test program to reproduce the bug.

Comment 1 Raghavendra G 2009-11-04 05:35:08 UTC
Created attachment 90 [details]
patch to fix this bug; should be submitted to Expect maintainers

Comment 2 Raghavendra G 2009-11-04 05:41:43 UTC
Created attachment 91 [details]
add --numeric-* options to netstat

Comment 3 Raghavendra G 2009-11-04 05:42:34 UTC
Created attachment 92 [details]
Test file to reproduce bug, with comments

Comment 4 Raghavendra G 2009-11-04 05:44:06 UTC
Created attachment 93 [details]
A replacement for the termcap-fixes.patch in the current srpm

the file being opened should be of non-zero length.

Comment 5 Raghavendra G 2009-11-04 08:33:33 UTC
smbd is running on booster. Booster is compiled from my custom branch and I will be attaching the patches committed only to my custom branch. mount.cifs is the samba client being used

While trying to build kernel on samba mount it fails complaining of open failing on a file with EBADF. And this bug can be reproduced by trying to open any non-zero sized file with flags O_WRONLY | O_TRUNC | O_LARGEFILE | O_CREAT. I've attached a small C program which can reproduce the issue.

The glusterfs logs (smbd is LD_PRELOADed with booster) show a successful completion of open and infact the smbd logs also say the same. As per smbd logs, even operations like fstat etc on opened fd are successful. However, dmesg output of cifs module says about not able to set the file-size of the file (cifs_setattr is failing with EBADF).

With glusterfs running as fuse-mount, kernel build runs fine albeit slow.

Comment 6 Raghavendra G 2009-11-04 16:14:58 UTC
ftruncate64 is not implemented by booster. Hence libc ftruncate64 was being called and resulted in EINVAL/EBADF errors.

Comment 7 Raghavendra G 2009-11-04 16:17:06 UTC
I missed that cifs client module actually breaks open with O_TRUNC into a truncate call followed by open. smbd in turn implements a truncate by opening the file and calling ftruncate on resulting fd. Hence we got EBADF error in open on samba client.

Comment 8 Raghavendra G 2009-11-12 14:20:44 UTC

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