Bug 761996 (GLUSTER-264)

Summary: creat is not resolved properly to the symbol defined in booster
Product: [Community] GlusterFS Reporter: Raghavendra G <raghavendra>
Component: boosterAssignee: Raghavendra G <raghavendra>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: 2.0.6CC: gluster-bugs, rabhat
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: RTNR Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Anand Avati 2009-09-15 11:19:41 UTC
PATCH: http://patches.gluster.com/patch/1365 in master (booster: use __REDIRECT macro to prevent creat being renamed to creat64.)

Comment 1 Anand Avati 2009-09-15 11:19:52 UTC
PATCH: http://patches.gluster.com/patch/1362 in release-2.0 (booster: use __REDIRECT macro to prevent creat being renamed to creat64.)

Comment 2 Raghavendra G 2009-09-15 13:20:54 UTC
nm on libglusterfs-booster.so shows only creat64 defined but not creat. This behavior is observed due to following reasons.

1. Booster is compiled with _FILE_OFFSET_BITS=64.
2. fcntl.h when included with _FILE_OFFSET_BITS=64 defined, renames all occurences of creat to creat64 in the source code from the point of #include <fcntl.h>.

fcntl.h should be included since booster.c uses many of the macros defined in that header and glusterfs (booster in turn) has to be compiled with _FILE_OFFSET_BITS=64 since glusterfs uses datatypes (off_t, stat etc) whose sizes vary depending on whether this macro is defined or not. Basically, this macro should be defined to provide portability across 32 and 64 bit architectures.

The correct fix is to make glusterfs to use datatypes big enough to hold 64 bit variants as well as 32 bit variants (like int64_t replacing off_t) and not to define _FILE_OFFSET_BITS=64 at all.

As a temporary work around,
1. we can implement creat functionality in a function with different name, say booster_false_creat
2. rename this function to creat using __REDIRECT macro. since this renaming happens after renaming of creat to creat64 (from the first __REDIRECT macro in fcntl.h), we will end up with creat symbol being defined in libglusterfs-booster.so