Bug 762080 (GLUSTER-348) - touch on booster segfaults
Summary: touch on booster segfaults
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: GLUSTER-348
Product: GlusterFS
Classification: Community
Component: libglusterfsclient
Version: mainline
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Raghavendra G
QA Contact:
URL:
Whiteboard:
: GLUSTER-345 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-10-30 06:03 UTC by Raghavendra G
Modified: 2009-11-18 10:00 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Regression: RTNR
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:


Attachments (Terms of Use)

Description Shehjar Tikoo 2009-10-30 05:36:10 UTC
*** Bug 345 has been marked as a duplicate of this bug. ***

Comment 1 Shehjar Tikoo 2009-10-30 05:45:25 UTC
There are two three things to note here.

1. This segfault will not occur in release2 since inode_link works fine when we
link root into the itable.

2. Avati says that the real fix lies in changing the if(name) condition in
inode_link to if (parent). Still, we'll merge Du's fix to maintain clarity in
libglusterfsclient to show that root inode is not to be linked.

We'll also merge my fix for the NULL check:
http://patches.gluster.com/patch/2060/

and a third patch that changes inode_link, all three being merged in the
Following branches:

Du's libglusterfsclient patch -      mainline only, since this happened because
of the gen number change.

Shehjar's NULL check patch    -      release2 and mainline

inode_link fix                -      mainline only, again to fine tune the gen
number changes.

Du, is it possible for you to send the third patch also?

Thanks

Comment 2 Anand Avati 2009-10-30 05:50:00 UTC
PATCH: http://patches.gluster.com/patch/2076 in master (libglusterfsclient: don't do inode_link on root inode.)

Comment 3 Raghavendra G 2009-10-30 06:03:36 UTC
(gdb) bt
#0  0xb7d44d6d in __dentry_search_arbit (inode=0x0) at ../../../libglusterfs/src/inode.c:808
#1  0xb7d44f83 in inode_path (inode=0x808e5e8, name=0x8090561 "newfilexx", bufp=0xbfad6910)
    at ../../../libglusterfs/src/inode.c:870
#2  0xb7d09110 in libgf_client_loc_fill (loc=0xbfad6964, ctx=0x8051e90, ino=0, par=1, name=0x8090561 "newfilexx")
    at ../../../libglusterfsclient/src/libglusterfsclient.c:924
#3  0xb7d1f495 in __do_path_resolve (loc=0xbfad6a28, ctx=0x8051e90, lookup_basename=1 '\001')
    at ../../../libglusterfsclient/src/libglusterfsclient-dentry.c:326
#4  0xb7d1f817 in libgf_client_path_lookup (loc=0xbfad6a28, ctx=0x8051e90, lookup_basename=1 '\001')
    at ../../../libglusterfsclient/src/libglusterfsclient-dentry.c:406
#5  0xb7d0f1ca in glusterfs_glh_open (handle=0x8051e90, path=0x8090500 "/newfilexx", flags=2369)
    at ../../../libglusterfsclient/src/libglusterfsclient.c:2797
#6  0xb7d0f701 in glusterfs_open (path=0xbfad735f "/mnt/raghu/newfilexx", flags=2369)
    at ../../../libglusterfsclient/src/libglusterfsclient.c:2926
#7  0xb7edb43a in vmp_open (pathname=0xbfad735f "/mnt/raghu/newfilexx", flags=2369)
    at ../../../booster/src/booster.c:392
#8  0xb7edb62c in booster_open (pathname=0xbfad735f "/mnt/raghu/newfilexx", use64=1, flags=2369)
    at ../../../booster/src/booster.c:455
#9  0xb7edb90f in *open64 (pathname=0xbfad735f "/mnt/raghu/newfilexx", flags=2369)
    at ../../../booster/src/booster.c:554
(gdb) l
813             }
814
815             if (!dentry) {
816                     list_for_each_entry (trav, &inode->dentry_list, inode_list) {
817                             dentry = trav;
818                             break;
819                     }
820             }
821
822             return dentry;


A dentry was added for root inode, which is incorrect. libgf_client_lookup_cbk should not call inode_link for '/'.

Comment 4 Shehjar Tikoo 2009-10-30 06:10:35 UTC
(In reply to comment #2)

> 
> Du, is it possible for you to send the third patch also?


Nevermind, I got it.

> 
> Thanks

Comment 5 Anand Avati 2009-10-30 07:37:46 UTC
PATCH: http://patches.gluster.com/patch/2081 in master (core: Check for NULL to avoid segfault)

Comment 6 Anand Avati 2009-10-30 07:37:53 UTC
PATCH: http://patches.gluster.com/patch/2086 in master (core: Use parent for condition to create dentry not name)

Comment 7 Anand Avati 2009-10-30 08:28:05 UTC
PATCH: http://patches.gluster.com/patch/2083 in release-2.0 (core: Check for NULL to avoid segfault)

Comment 8 Raghavendra G 2009-10-30 13:06:22 UTC
(In reply to comment #2)
> There are two three things to note here.
> 
> 1. This segfault will not occur in release2 since inode_link works fine when we
> link root into the itable.

> 
> 2. Avati says that the real fix lies in changing the if(name) condition in
> inode_link to if (parent). Still, we'll merge Du's fix to maintain clarity in
> libglusterfsclient to show that root inode is not to be linked.

I thought of the same fix. But after speaking to avati, I felt it may be better to fix libglusterfsclient.

> 
> We'll also merge my fix for the NULL check:
> http://patches.gluster.com/patch/2060/
> 
> and a third patch that changes inode_link, all three being merged in the
> Following branches:
> 
> Du's libglusterfsclient patch -      mainline only, since this happened because
> of the gen number change.

This fix is not calling inode_link on root inode, right? Since it is not correct to call inode_link on root inode, should we not also fix this in release-2.0, even though there is no issue over there?

> 
> Shehjar's NULL check patch    -      release2 and mainline
> 
> inode_link fix                -      mainline only, again to fine tune the gen
> number changes.

Change if (name) to if (parent) before adding a dentry. right?

> 
> Du, is it possible for you to send the third patch also?

Yes, I'll do it.

> 
> Thanks

Comment 9 Shehjar Tikoo 2009-10-30 13:17:47 UTC
(In reply to comment #8)
> (In reply to comment #2)
> > There are two three things to note here.
> > 
> > 1. This segfault will not occur in release2 since inode_link works fine when we
> > link root into the itable.
> 
> > 
> > 2. Avati says that the real fix lies in changing the if(name) condition in
> > inode_link to if (parent). Still, we'll merge Du's fix to maintain clarity in
> > libglusterfsclient to show that root inode is not to be linked.
> 
> I thought of the same fix. But after speaking to avati, I felt it may be better
> to fix libglusterfsclient.
> 

I guess he changed his mind later about changing inode.c

> > 
> > We'll also merge my fix for the NULL check:
> > http://patches.gluster.com/patch/2060/
> > 
> > and a third patch that changes inode_link, all three being merged in the
> > Following branches:
> > 
> > Du's libglusterfsclient patch -      mainline only, since this happened because
> > of the gen number change.
> 
> This fix is not calling inode_link on root inode, right? Since it is not
Yes. This is what you sent.

> correct to call inode_link on root inode, should we not also fix this in
> release-2.0, even though there is no issue over there?

I dont see why we should fix it in r2. The segfault occurred only because of the
inode generation number change and that is only in mainline.

> 
> > 
> > Shehjar's NULL check patch    -      release2 and mainline
> > 
> > inode_link fix                -      mainline only, again to fine tune the gen
> > number changes.
> 
> Change if (name) to if (parent) before adding a dentry. right?
> 
> > 
> > Du, is it possible for you to send the third patch also?
> 
> Yes, I'll do it.

The patch has been submitted already. Dont worry about it.
> 
> > 
> > Thanks


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