Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 146881 Details for
Bug 217356
GFS2 hangs waiting for semaphore?
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
glock re-ordering
unlink_deadlock (text/plain), 5.17 KB, created by
Russell Cattelan
on 2007-01-29 23:17:07 UTC
(
hide
)
Description:
glock re-ordering
Filename:
MIME Type:
Creator:
Russell Cattelan
Created:
2007-01-29 23:17:07 UTC
Size:
5.17 KB
patch
obsolete
>Index: work_gfs/fs/gfs2/ops_inode.c >=================================================================== >--- work_gfs.orig/fs/gfs2/ops_inode.c 2007-01-26 16:44:20.401856819 -0600 >+++ work_gfs/fs/gfs2/ops_inode.c 2007-01-26 16:44:37.202061800 -0600 >@@ -264,13 +264,23 @@ static int gfs2_unlink(struct inode *dir > struct gfs2_inode *dip = GFS2_I(dir); > struct gfs2_sbd *sdp = GFS2_SB(dir); > struct gfs2_inode *ip = GFS2_I(dentry->d_inode); >- struct gfs2_holder ghs[2]; >+ struct gfs2_holder ghs[3]; >+ struct gfs2_rgrpd *rgd; >+ struct gfs2_holder ri_gh; > int error; > >+ error = gfs2_rindex_hold(sdp, &ri_gh); >+ if (error) >+ return error; >+ > gfs2_holder_init(dip->i_gl, LM_ST_EXCLUSIVE, 0, ghs); >- gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, ghs + 1); >+ gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, ghs + 1); >+ >+ rgd = gfs2_blk2rgrpd(sdp, ip->i_num.no_addr); >+ gfs2_holder_init(rgd->rd_gl, LM_ST_EXCLUSIVE, 0, ghs + 2); >+ > >- error = gfs2_glock_nq_m(2, ghs); >+ error = gfs2_glock_nq_m(3, ghs); > if (error) > goto out; > >@@ -291,10 +301,12 @@ static int gfs2_unlink(struct inode *dir > out_end_trans: > gfs2_trans_end(sdp); > out_gunlock: >- gfs2_glock_dq_m(2, ghs); >+ gfs2_glock_dq_m(3, ghs); > out: > gfs2_holder_uninit(ghs); > gfs2_holder_uninit(ghs + 1); >+ gfs2_holder_uninit(ghs + 2); >+ gfs2_glock_dq_uninit(&ri_gh); > return error; > } > >@@ -449,13 +461,22 @@ static int gfs2_rmdir(struct inode *dir, > struct gfs2_inode *dip = GFS2_I(dir); > struct gfs2_sbd *sdp = GFS2_SB(dir); > struct gfs2_inode *ip = GFS2_I(dentry->d_inode); >- struct gfs2_holder ghs[2]; >+ struct gfs2_holder ghs[3]; >+ struct gfs2_rgrpd *rgd; >+ struct gfs2_holder ri_gh; > int error; > >+ >+ error = gfs2_rindex_hold(sdp, &ri_gh); >+ if (error) >+ return error; > gfs2_holder_init(dip->i_gl, LM_ST_EXCLUSIVE, 0, ghs); > gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, ghs + 1); > >- error = gfs2_glock_nq_m(2, ghs); >+ rgd = gfs2_blk2rgrpd(sdp, ip->i_num.no_addr); >+ gfs2_holder_init(rgd->rd_gl, LM_ST_EXCLUSIVE, 0, ghs + 2); >+ >+ error = gfs2_glock_nq_m(3, ghs); > if (error) > goto out; > >@@ -483,10 +504,12 @@ static int gfs2_rmdir(struct inode *dir, > gfs2_trans_end(sdp); > > out_gunlock: >- gfs2_glock_dq_m(2, ghs); >+ gfs2_glock_dq_m(3, ghs); > out: > gfs2_holder_uninit(ghs); > gfs2_holder_uninit(ghs + 1); >+ gfs2_holder_uninit(ghs + 2); >+ gfs2_glock_dq_uninit(&ri_gh); > return error; > } > >@@ -547,7 +570,8 @@ static int gfs2_rename(struct inode *odi > struct gfs2_inode *ip = GFS2_I(odentry->d_inode); > struct gfs2_inode *nip = NULL; > struct gfs2_sbd *sdp = GFS2_SB(odir); >- struct gfs2_holder ghs[4], r_gh; >+ struct gfs2_holder ghs[5], r_gh; >+ struct gfs2_rgrpd *nrgd; > unsigned int num_gh; > int dir_rename = 0; > int alloc_required; >@@ -587,6 +611,11 @@ static int gfs2_rename(struct inode *odi > if (nip) { > gfs2_holder_init(nip->i_gl, LM_ST_EXCLUSIVE, 0, ghs + num_gh); > num_gh++; >+ /* grab the resource lok for unlink flag twiddling >+ * this is the case of the target file already existing */ >+ nrgd = gfs2_blk2rgrpd(sdp, nip->i_num.no_addr); >+ if (nrgd) >+ gfs2_holder_init(nrgd->rd_gl, LM_ST_EXCLUSIVE, 0, ghs + num_gh++); > } > > error = gfs2_glock_nq_m(num_gh, ghs); >@@ -697,9 +726,9 @@ static int gfs2_rename(struct inode *odi > /* Remove the target file, if it exists */ > > if (nip) { >- if (S_ISDIR(nip->i_inode.i_mode)) >+ if (S_ISDIR(nip->i_inode.i_mode)) { > error = gfs2_rmdiri(ndip, &ndentry->d_name, nip); >- else { >+ } else { > error = gfs2_dir_del(ndip, &ndentry->d_name); > if (error) > goto out_end_trans; >Index: work_gfs/fs/gfs2/inode.c >=================================================================== >--- work_gfs.orig/fs/gfs2/inode.c 2007-01-26 16:44:20.401856819 -0600 >+++ work_gfs/fs/gfs2/inode.c 2007-01-26 16:45:15.354527275 -0600 >@@ -280,50 +280,6 @@ out: > return error; > } > >-static int gfs2_change_nlink_i(struct gfs2_inode *ip) >-{ >- struct gfs2_sbd *sdp = ip->i_inode.i_sb->s_fs_info; >- struct gfs2_inode *rindex = GFS2_I(sdp->sd_rindex); >- struct gfs2_glock *ri_gl = rindex->i_gl; >- struct gfs2_rgrpd *rgd; >- struct gfs2_holder ri_gh, rg_gh; >- int existing, error; >- >- /* if we come from rename path, we could have the lock already */ >- existing = gfs2_glock_is_locked_by_me(ri_gl); >- if (!existing) { >- error = gfs2_rindex_hold(sdp, &ri_gh); >- if (error) >- goto out; >- } >- >- /* find the matching rgd */ >- error = -EIO; >- rgd = gfs2_blk2rgrpd(sdp, ip->i_num.no_addr); >- if (!rgd) >- goto out_norgrp; >- >- /* >- * Eventually we may want to move rgd(s) to a linked list >- * and piggyback the free logic into one of gfs2 daemons >- * to gain some performance. >- */ >- if (!rgd->rd_gl || !gfs2_glock_is_locked_by_me(rgd->rd_gl)) { >- error = gfs2_glock_nq_init(rgd->rd_gl, LM_ST_EXCLUSIVE, 0, &rg_gh); >- if (error) >- goto out_norgrp; >- >- gfs2_unlink_di(&ip->i_inode); /* mark inode unlinked */ >- gfs2_glock_dq_uninit(&rg_gh); >- } >- >-out_norgrp: >- if (!existing) >- gfs2_glock_dq_uninit(&ri_gh); >-out: >- return error; >-} >- > /** > * gfs2_change_nlink - Change nlink count on inode > * @ip: The GFS2 inode >@@ -365,7 +321,7 @@ int gfs2_change_nlink(struct gfs2_inode > mark_inode_dirty(&ip->i_inode); > > if (ip->i_inode.i_nlink == 0) >- error = gfs2_change_nlink_i(ip); >+ gfs2_unlink_di(&ip->i_inode); /* mark inode unlinked */ > > return error; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 217356
:
142167
|
142168
|
142255
|
142256
|
142257
|
142258
|
142905
|
144819
| 146881 |
152908