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 315399 Details for
Bug 458684
GFS2: glock deadlock in page fault path
[?]
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]
Bob's rwsem patch
458684.bob1.patch (text/plain), 6.73 KB, created by
Robert Peterson
on 2008-08-29 20:25:40 UTC
(
hide
)
Description:
Bob's rwsem patch
Filename:
MIME Type:
Creator:
Robert Peterson
Created:
2008-08-29 20:25:40 UTC
Size:
6.73 KB
patch
obsolete
>diff -pur a/fs/gfs2/incore.h b/fs/gfs2/incore.h >--- a/fs/gfs2/incore.h 2008-08-21 12:16:07.000000000 -0500 >+++ b/fs/gfs2/incore.h 2008-08-29 13:49:49.000000000 -0500 >@@ -260,6 +260,7 @@ struct gfs2_inode { > u64 i_goal; /* goal block for allocations */ > struct rw_semaphore i_rw_mutex; > u8 i_height; >+ u8 i_prepwork_state; > }; > > /* >diff -pur a/fs/gfs2/log.c b/fs/gfs2/log.c >--- a/fs/gfs2/log.c 2008-08-21 12:16:03.000000000 -0500 >+++ b/fs/gfs2/log.c 2008-08-29 13:58:57.000000000 -0500 >@@ -291,7 +291,7 @@ static void ail2_empty(struct gfs2_sbd * > * Returns: errno > */ > >-int gfs2_log_reserve(struct gfs2_sbd *sdp, unsigned int blks, int wait) >+int gfs2_log_reserve(struct gfs2_sbd *sdp, unsigned int blks) > { > unsigned int try = 0; > unsigned reserved_blks = 6 * (4096 / sdp->sd_vfs->s_blocksize); >@@ -304,10 +304,6 @@ int gfs2_log_reserve(struct gfs2_sbd *sd > gfs2_log_lock(sdp); > while(sdp->sd_log_blks_free <= (blks + reserved_blks)) { > gfs2_log_unlock(sdp); >- if (!wait) { >- mutex_unlock(&sdp->sd_log_reserve_mutex); >- return -EBUSY; >- } > gfs2_ail1_empty(sdp, 0); > gfs2_log_flush(sdp, NULL); > >@@ -317,21 +313,9 @@ int gfs2_log_reserve(struct gfs2_sbd *sd > } > sdp->sd_log_blks_free -= blks; > gfs2_log_unlock(sdp); >+ mutex_unlock(&sdp->sd_log_reserve_mutex); > >- if (wait){ >- mutex_unlock(&sdp->sd_log_reserve_mutex); >- down_read(&sdp->sd_log_flush_lock); >- } >- else { >- if (!down_read_trylock(&sdp->sd_log_flush_lock)) { >- gfs2_log_lock(sdp); >- sdp->sd_log_blks_free += blks; >- gfs2_log_unlock(sdp); >- mutex_unlock(&sdp->sd_log_reserve_mutex); >- return -EBUSY; >- } >- mutex_unlock(&sdp->sd_log_reserve_mutex); >- } >+ down_read(&sdp->sd_log_flush_lock); > return 0; > } > >diff -pur a/fs/gfs2/log.h b/fs/gfs2/log.h >--- a/fs/gfs2/log.h 2008-08-21 12:15:58.000000000 -0500 >+++ b/fs/gfs2/log.h 2008-08-29 13:52:43.000000000 -0500 >@@ -50,7 +50,7 @@ unsigned int gfs2_struct2blk(struct gfs2 > > int gfs2_ail1_empty(struct gfs2_sbd *sdp, int flags); > >-int gfs2_log_reserve(struct gfs2_sbd *sdp, unsigned int blks, int wait); >+int gfs2_log_reserve(struct gfs2_sbd *sdp, unsigned int blks); > void gfs2_log_release(struct gfs2_sbd *sdp, unsigned int blks); > void gfs2_log_incr_head(struct gfs2_sbd *sdp); > >diff -pur a/fs/gfs2/main.c b/fs/gfs2/main.c >--- a/fs/gfs2/main.c 2008-08-21 12:16:07.000000000 -0500 >+++ b/fs/gfs2/main.c 2008-08-29 13:52:55.000000000 -0500 >@@ -33,6 +33,7 @@ static void gfs2_init_inode_once(void *f > init_rwsem(&ip->i_rw_mutex); > ip->i_alloc = NULL; > ip->i_gh.gh_gl = NULL; >+ ip->i_prepwork_state = 0; > } > } > >diff -pur a/fs/gfs2/ops_address.c b/fs/gfs2/ops_address.c >--- a/fs/gfs2/ops_address.c 2008-08-21 12:16:07.000000000 -0500 >+++ b/fs/gfs2/ops_address.c 2008-08-29 14:08:25.000000000 -0500 >@@ -216,7 +216,7 @@ static int gfs2_jdata_writepage(struct p > if (PageChecked(page)) { > if (wbc->sync_mode != WB_SYNC_ALL) > goto out_ignore; >- error = gfs2_do_trans_begin(sdp, RES_DINODE + 1, 0, 0); >+ error = gfs2_trans_begin(sdp, RES_DINODE + 1, 0); > if (error) > goto out_ignore; > done_trans = 1; >@@ -599,10 +599,20 @@ static int gfs2_write_lock_start(struct > struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); > unsigned int data_blocks, ind_blocks, rblocks; > struct gfs2_alloc *al; >+ struct gfs2_trans *tr; > int ret; > >- if (gfs2_glock_is_locked_by_me(ip->i_gl)) >+ ip->i_prepwork_state++; >+ if (gfs2_glock_is_locked_by_me(ip->i_gl)) { >+ if (ip->i_prepwork_state == 2) { >+ tr = current->journal_info; >+ ret = gfs2_log_reserve(sdp, tr->tr_reserved); >+ if (ret) >+ goto out_reserve_fail; >+ } >+ BUG_ON(ip->i_prepwork_state == 1); > return 0; >+ } > > gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, GL_ATIME, gh); > unlock_page(page); >@@ -641,13 +651,20 @@ static int gfs2_write_lock_start(struct > if (ind_blocks || data_blocks) > rblocks += RES_STATFS + RES_QUOTA; > >- ret = gfs2_trans_begin(sdp, rblocks, PAGE_CACHE_SIZE/sdp->sd_sb.sb_bsize); >+ ret = gfs2_trans_begin_noreserve(sdp, rblocks, >+ PAGE_CACHE_SIZE/sdp->sd_sb.sb_bsize); > if (ret) > goto out_trans_fail; > > yield(); > return AOP_TRUNCATED_PAGE; > >+out_reserve_fail: >+ gfs2_glock_dq(&tr->tr_t_gh); >+ gfs2_holder_uninit(&tr->tr_t_gh); >+ kfree(tr); >+ current->journal_info = NULL; >+ > out_trans_fail: > if (*alloc_required) { > gfs2_inplace_release(ip); >@@ -767,6 +784,7 @@ static int gfs2_commit_write(struct file > if (gfs2_assert_withdraw(sdp, gfs2_glock_is_locked_by_me(ip->i_gl))) > goto fail_nounlock; > >+ ip->i_prepwork_state = 0; > error = gfs2_meta_inode_buffer(ip, &dibh); > if (error) > goto fail_endtrans; >diff -pur a/fs/gfs2/trans.c b/fs/gfs2/trans.c >--- a/fs/gfs2/trans.c 2008-08-21 12:16:03.000000000 -0500 >+++ b/fs/gfs2/trans.c 2008-08-29 13:57:38.000000000 -0500 >@@ -25,8 +25,8 @@ > #include "trans.h" > #include "util.h" > >-int gfs2_do_trans_begin(struct gfs2_sbd *sdp, unsigned int blocks, >- unsigned int revokes, int wait) >+static int gfs2_do_trans_begin(struct gfs2_sbd *sdp, unsigned int blocks, >+ unsigned int revokes, int reserve) > { > struct gfs2_trans *tr; > int error; >@@ -61,10 +61,11 @@ int gfs2_do_trans_begin(struct gfs2_sbd > goto fail_gunlock; > } > >- error = gfs2_log_reserve(sdp, tr->tr_reserved, wait); >- if (error) >- goto fail_gunlock; >- >+ if (reserve) { >+ error = gfs2_log_reserve(sdp, tr->tr_reserved); >+ if (error) >+ goto fail_gunlock; >+ } > current->journal_info = tr; > > return 0; >@@ -79,6 +80,18 @@ fail_holder_uninit: > return error; > } > >+int gfs2_trans_begin(struct gfs2_sbd *sdp, unsigned int blocks, >+ unsigned int revokes) >+{ >+ return gfs2_do_trans_begin(sdp, blocks, revokes, 1); >+} >+ >+int gfs2_trans_begin_noreserve(struct gfs2_sbd *sdp, unsigned int blocks, >+ unsigned int revokes) >+{ >+ return gfs2_do_trans_begin(sdp, blocks, revokes, 0); >+} >+ > void gfs2_trans_end(struct gfs2_sbd *sdp) > { > struct gfs2_trans *tr = current->journal_info; >diff -pur a/fs/gfs2/trans.h b/fs/gfs2/trans.h >--- a/fs/gfs2/trans.h 2008-08-21 12:15:57.000000000 -0500 >+++ b/fs/gfs2/trans.h 2008-08-29 14:40:56.000000000 -0500 >@@ -25,8 +25,10 @@ struct gfs2_glock; > #define RES_STATFS 1 > #define RES_QUOTA 2 > >-int gfs2_do_trans_begin(struct gfs2_sbd *sdp, unsigned int blocks, >- unsigned int revokes, int wait); >+int gfs2_trans_begin(struct gfs2_sbd *sdp, unsigned int blocks, >+ unsigned int revokes); >+int gfs2_trans_begin_noreserve(struct gfs2_sbd *sdp, unsigned int blocks, >+ unsigned int revokes); > > void gfs2_trans_end(struct gfs2_sbd *sdp); > >@@ -36,11 +38,4 @@ void gfs2_trans_add_revoke(struct gfs2_s > void gfs2_trans_add_unrevoke(struct gfs2_sbd *sdp, u64 blkno); > void gfs2_trans_add_rg(struct gfs2_rgrpd *rgd); > >- >-static inline int gfs2_trans_begin(struct gfs2_sbd *sdp, unsigned int blocks, >- unsigned int revokes) >-{ >- return gfs2_do_trans_begin(sdp, blocks, revokes, 1); >-} >- > #endif /* __TRANS_DOT_H__ */
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 458684
:
314028
|
314549
|
314680
|
314745
|
314760
|
314761
|
314762
|
314981
|
315157
|
315399
|
315400
|
315660
|
316226
|
316480
|
316579
|
316802