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 296621 Details for
Bug 183119
Assertion failure in journal_next_log_block
[?]
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]
upstream backport.
jbd-modified-fix-rhel4.patch (text/plain), 6.49 KB, created by
Josef Bacik
on 2008-03-03 16:02:09 UTC
(
hide
)
Description:
upstream backport.
Filename:
MIME Type:
Creator:
Josef Bacik
Created:
2008-03-03 16:02:09 UTC
Size:
6.49 KB
patch
obsolete
>Index: linux-2.6.9/fs/jbd/commit.c >=================================================================== >--- linux-2.6.9.orig/fs/jbd/commit.c >+++ linux-2.6.9/fs/jbd/commit.c >@@ -365,6 +365,9 @@ write_out_data: > */ > commit_transaction->t_state = T_COMMIT; > >+ J_ASSERT(commit_transaction->t_nr_buffers <= >+ commit_transaction->t_outstanding_credits); >+ > descriptor = NULL; > bufs = 0; > while (commit_transaction->t_buffers) { >Index: linux-2.6.9/fs/jbd/transaction.c >=================================================================== >--- linux-2.6.9.orig/fs/jbd/transaction.c >+++ linux-2.6.9/fs/jbd/transaction.c >@@ -600,6 +600,12 @@ repeat: > goto done; > > /* >+ * this is the first time this transaction is touching this buffer, >+ * reset the modified flag >+ */ >+ jh->b_modified = 0; >+ >+ /* > * If there is already a copy-out version of this buffer, then we don't > * need to make another one > */ >@@ -607,11 +613,6 @@ repeat: > JBUFFER_TRACE(jh, "has frozen data"); > J_ASSERT_JH(jh, jh->b_next_transaction == NULL); > jh->b_next_transaction = transaction; >- >- J_ASSERT_JH(jh, handle->h_buffer_credits > 0); >- handle->h_buffer_credits--; >- if (credits) >- (*credits)++; > goto done; > } > >@@ -690,11 +691,6 @@ repeat: > jh->b_next_transaction = transaction; > } > >- J_ASSERT(handle->h_buffer_credits > 0); >- handle->h_buffer_credits--; >- if (credits) >- (*credits)++; >- > /* > * Finally, if the buffer is not journaled right now, we need to make > * sure it doesn't get written to disk before the caller actually >@@ -816,14 +812,18 @@ int journal_get_create_access(handle_t * > J_ASSERT_JH(jh, jh->b_next_transaction == NULL); > J_ASSERT_JH(jh, buffer_locked(jh2bh(jh))); > >- J_ASSERT_JH(jh, handle->h_buffer_credits > 0); >- handle->h_buffer_credits--; >- > if (jh->b_transaction == NULL) { > jh->b_transaction = transaction; >+ >+ /* first access by this transaction */ >+ jh->b_modified = 0; >+ > JBUFFER_TRACE(jh, "file as BJ_Reserved"); > __journal_file_buffer(jh, transaction, BJ_Reserved); > } else if (jh->b_transaction == journal->j_committing_transaction) { >+ /* first access by this transaction */ >+ jh->b_modified = 0; >+ > JBUFFER_TRACE(jh, "set next transaction"); > jh->b_next_transaction = transaction; > } >@@ -1119,6 +1119,17 @@ int journal_dirty_metadata(handle_t *han > > jbd_lock_bh_state(bh); > >+ if (jh->b_modified == 0) { >+ /* >+ * This buffer's got modified and becoming part >+ * of the transaction. This needs to be done >+ * once a transaction -bzzz >+ */ >+ jh->b_modified = 1; >+ J_ASSERT_JH(jh, handle->h_buffer_credits > 0); >+ handle->h_buffer_credits--; >+ } >+ > /* > * fastpath, to avoid expensive locking. If this buffer is already > * on the running transaction's metadata list there is nothing to do. >@@ -1168,25 +1179,11 @@ out: > /* > * journal_release_buffer: undo a get_write_access without any buffer > * updates, if the update decided in the end that it didn't need access. >- * >- * The caller passes in the number of credits which should be put back for >- * this buffer (zero or one). >- * >- * We leave the buffer attached to t_reserved_list because even though this >- * handle doesn't want it, some other concurrent handle may want to journal >- * this buffer. If that handle is curently in between get_write_access() and >- * journal_dirty_metadata() then it expects the buffer to be reserved. If >- * we were to rip it off t_reserved_list here, the other handle will explode >- * when journal_dirty_metadata is presented with a non-reserved buffer. >- * >- * If nobody really wants to journal this buffer then it will be thrown >- * away at the start of commit. > */ > void > journal_release_buffer(handle_t *handle, struct buffer_head *bh, int credits) > { > BUFFER_TRACE(bh, "entry"); >- handle->h_buffer_credits += credits; > } > > /** >@@ -1211,8 +1208,10 @@ int journal_forget (handle_t *handle, st > transaction_t *transaction = handle->h_transaction; > journal_t *journal = transaction->t_journal; > struct journal_head *jh; >+ int drop_reserve = 0; > int err = 0; >- >+ int was_modified = 0; >+ > BUFFER_TRACE(bh, "entry"); > > jbd_lock_bh_state(bh); >@@ -1230,6 +1229,15 @@ int journal_forget (handle_t *handle, st > goto not_jbd; > } > >+ /* keep track of wether or not this transaction modified us */ >+ was_modified = jh->b_modified; >+ >+ /* >+ * The buffer's going from the transaction, we must drop >+ * all references -bzzz >+ */ >+ jh->b_modified = 0; >+ > if (jh->b_transaction == handle->h_transaction) { > J_ASSERT_JH(jh, !jh->b_frozen_data); > >@@ -1241,6 +1249,13 @@ int journal_forget (handle_t *handle, st > > JBUFFER_TRACE(jh, "belongs to current transaction: unfile"); > >+ /* >+ * we only want to drop a reference if this transaction >+ * modified the buffer >+ */ >+ if (was_modified) >+ drop_reserve = 1; >+ > /* > * We are no longer going to journal this buffer. > * However, the commit of this transaction is still >@@ -1264,7 +1279,7 @@ int journal_forget (handle_t *handle, st > spin_unlock(&journal->j_list_lock); > jbd_unlock_bh_state(bh); > __bforget(bh); >- return 0; >+ goto drop; > } > } > } else if (jh->b_transaction) { >@@ -1279,6 +1294,13 @@ int journal_forget (handle_t *handle, st > if (jh->b_next_transaction) { > J_ASSERT(jh->b_next_transaction == transaction); > jh->b_next_transaction = NULL; >+ >+ /* >+ * only drop a reference if this transaction >+ * modified the buffer >+ */ >+ if (was_modified) >+ drop_reserve = 1; > } > } > >@@ -1286,6 +1308,12 @@ not_jbd: > spin_unlock(&journal->j_list_lock); > jbd_unlock_bh_state(bh); > __brelse(bh); >+drop: >+ if (drop_reserve) { >+ /* no need to reserve log space for this block -bzzz */ >+ handle->h_buffer_credits++; >+ } >+ > return err; > } > >@@ -2072,7 +2100,7 @@ void __journal_refile_buffer(struct jour > jh->b_transaction = jh->b_next_transaction; > jh->b_next_transaction = NULL; > __journal_file_buffer(jh, jh->b_transaction, >- was_dirty ? BJ_Metadata : BJ_Reserved); >+ jh->b_modified ? BJ_Metadata : BJ_Reserved); > J_ASSERT_JH(jh, jh->b_transaction->t_state == T_RUNNING); > > if (was_dirty) >Index: linux-2.6.9/include/linux/journal-head.h >=================================================================== >--- linux-2.6.9.orig/include/linux/journal-head.h >+++ linux-2.6.9/include/linux/journal-head.h >@@ -80,6 +80,15 @@ struct journal_head { > * [j_list_lock] > */ > struct journal_head *b_cpnext, *b_cpprev; >+ >+ /* >+ * This flag signals the buffer has been modified by the currently >+ * running transaction >+ * [jbd_lock_bh_state()] >+ */ >+#ifndef __GENKSYMS__ >+ unsigned b_modified; >+#endif > }; > > #endif /* JOURNAL_HEAD_H_INCLUDED */
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 183119
:
143420
|
144402
|
291901
|
292185
|
292225
|
292398
|
292657
|
292682
|
293429
|
293746
|
293757
|
295041
|
295315
| 296621