Bug 761992 (GLUSTER-260)

Summary: ls on booster VMP results in error: "File descriptor in bad state"
Product: [Community] GlusterFS Reporter: Shehjar Tikoo <shehjart>
Component: write-behindAssignee: Raghavendra G <raghavendra>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: high    
Version: mainlineCC: 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: RTA Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Booster FSTAB file
none
Client vol file
none
Booster log
none
Server vol file none

Description Shehjar Tikoo 2009-09-15 03:06:55 UTC
Created attachment 66 [details]
This gzipped patch should fix the probe output parsing

Comment 1 Shehjar Tikoo 2009-09-15 03:07:25 UTC
Created attachment 67 [details]
Please use this one, the other one contained a minor oversight

Comment 2 Shehjar Tikoo 2009-09-15 03:07:51 UTC
Created attachment 68 [details]
Fixed xtermfix (patch)

Comment 3 Shehjar Tikoo 2009-09-15 03:08:23 UTC
Created attachment 69 [details]
Patch for /etc/termcap which fixes the described problems

Comment 4 Shehjar Tikoo 2009-09-15 03:09:26 UTC
The test was done my me on release-2.0 branch but the fix needs to be committed to both mainline and r2.

Comment 5 Shehjar Tikoo 2009-09-15 06:06:16 UTC
Reported by Wei Dong on gluster-users and confirmed by myself.

For the attached log files and booster.conf, the following command results in an error:

root@indus:glusterfs# LD_PRELOAD=/usr/local/lib/glusterfs/glusterfs-booster.so ls /gluster
ls: closing directory /gluster: File descriptor in bad state
root@indus:glusterfs# 

The log file, shoes the following error message:
[2009-09-15 11:28:38] D [booster.c:1738:closedir] booster: closedir on gluster
[2009-09-15 11:28:38] D [write-behind.c:1705:wb_flush] client: write behind file pointer is not stored in context of fd(0x628230), returning EBADFD

The close dir in booster is resulting in a wb_flush which expects a fd context to be stored for every fd_t. The fix requires that we add a special case of directories since write-behind does not handle directory fops.

Comment 6 Anand Avati 2009-09-22 10:12:33 UTC
PATCH: http://patches.gluster.com/patch/1383 in master (performance/write-behind: check for the presence of context only in fds not opened on directories.)

Comment 7 Anand Avati 2009-09-22 10:13:42 UTC
PATCH: http://patches.gluster.com/patch/1382 in release-2.0 (performance/write-behind: check for the presence of context only in fds not opened on directories.)

Comment 8 Raghavendra G 2009-09-24 08:36:04 UTC
Crashes are observed because of lack of NULL checks on file pointer.

Comment 9 Anand Avati 2009-09-24 09:19:40 UTC
PATCH: http://patches.gluster.com/patch/1489 in release-2.0 (performance/write-behind: Add NULL checks for file pointer.)

Comment 10 Anand Avati 2009-09-24 11:13:44 UTC
PATCH: http://patches.gluster.com/patch/1490 in release-2.0 (write-behind: check for NULL file pointer in flush callback)

Comment 11 Anand Avati 2009-10-09 02:59:47 UTC
PATCH: http://patches.gluster.com/patch/1834 in master (performance/write-behind: Refining the check for fd_ctx in fds)