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 306272 Details for
Bug 439194
Assertion failure in journal_start() at fs/jbd/transaction.c:274: 'handle->h_transaction->t_journal == journal'
[?]
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]
patch.
ext3-fix-dio-memory-pressure-problem.patch (text/plain), 4.65 KB, created by
Josef Bacik
on 2008-05-21 16:03:27 UTC
(
hide
)
Description:
patch.
Filename:
MIME Type:
Creator:
Josef Bacik
Created:
2008-05-21 16:03:27 UTC
Size:
4.65 KB
patch
obsolete
>Index: kernel/fs/ext3/inode.c >=================================================================== >--- kernel.orig/fs/ext3/inode.c >+++ kernel/fs/ext3/inode.c >@@ -941,55 +941,45 @@ out: > return err; > } > >-#define DIO_CREDITS (EXT3_RESERVE_TRANS_BLOCKS + 32) >+/* Maximum number of blocks we map for direct IO at once. */ >+#define DIO_MAX_BLOCKS 4096 >+/* >+ * Number of credits we need for writing DIO_MAX_BLOCKS: >+ * We need sb + group descriptor + bitmap + inode -> 4 >+ * For B blocks with A block pointers per block we need: >+ * 1 (triple ind.) + (B/A/A + 2) (doubly ind.) + (B/A + 2) (indirect). >+ * If we plug in 4096 for B and 256 for A (for 1KB block size), we get 25. >+ */ >+#define DIO_CREDITS 25 > > static int ext3_get_block(struct inode *inode, sector_t iblock, > struct buffer_head *bh_result, int create) > { > handle_t *handle = journal_current_handle(); >- int ret = 0; >+ int ret = 0, started = 0; > unsigned max_blocks = bh_result->b_size >> inode->i_blkbits; > >- if (!create) >- goto get_block; /* A read */ >- >- if (max_blocks == 1) >- goto get_block; /* A single block get */ >- >- if (handle->h_transaction->t_state == T_LOCKED) { >- /* >- * Huge direct-io writes can hold off commits for long >- * periods of time. Let this commit run. >- */ >- ext3_journal_stop(handle); >- handle = ext3_journal_start(inode, DIO_CREDITS); >- if (IS_ERR(handle)) >+ if (create && !handle) { /* Direct IO write... */ >+ if (max_blocks > DIO_MAX_BLOCKS) >+ max_blocks = DIO_MAX_BLOCKS; >+ handle = ext3_journal_start(inode, DIO_CREDITS + >+ 2 * EXT3_QUOTA_TRANS_BLOCKS(inode->i_sb)); >+ if (IS_ERR(handle)) { > ret = PTR_ERR(handle); >- goto get_block; >- } >- >- if (handle->h_buffer_credits <= EXT3_RESERVE_TRANS_BLOCKS) { >- /* >- * Getting low on buffer credits... >- */ >- ret = ext3_journal_extend(handle, DIO_CREDITS); >- if (ret > 0) { >- /* >- * Couldn't extend the transaction. Start a new one. >- */ >- ret = ext3_journal_restart(handle, DIO_CREDITS); >+ goto out; > } >+ started = 1; > } > >-get_block: >- if (ret == 0) { >- ret = ext3_get_blocks_handle(handle, inode, iblock, >+ ret = ext3_get_blocks_handle(handle, inode, iblock, > max_blocks, bh_result, create, 0); >- if (ret > 0) { >- bh_result->b_size = (ret << inode->i_blkbits); >- ret = 0; >- } >+ if (ret > 0) { >+ bh_result->b_size = (ret << inode->i_blkbits); >+ ret = 0; > } >+ if (started) >+ ext3_journal_stop(handle); >+out: > return ret; > } > >@@ -1613,7 +1603,8 @@ static int ext3_releasepage(struct page > * if the machine crashes during the write. > * > * If the O_DIRECT write is intantiating holes inside i_size and the machine >- * crashes then stale disk data _may_ be exposed inside the file. >+ * crashes then stale disk data _may_ be exposed inside the file. But current >+ * VFS code falls back into buffered path in that case so we are safe. > */ > static ssize_t ext3_direct_IO(int rw, struct kiocb *iocb, > const struct iovec *iov, loff_t offset, >@@ -1622,7 +1613,7 @@ static ssize_t ext3_direct_IO(int rw, st > struct file *file = iocb->ki_filp; > struct inode *inode = file->f_mapping->host; > struct ext3_inode_info *ei = EXT3_I(inode); >- handle_t *handle = NULL; >+ handle_t *handle; > ssize_t ret; > int orphan = 0; > size_t count = iov_length(iov, nr_segs); >@@ -1630,17 +1621,21 @@ static ssize_t ext3_direct_IO(int rw, st > if (rw == WRITE) { > loff_t final_size = offset + count; > >- handle = ext3_journal_start(inode, DIO_CREDITS); >- if (IS_ERR(handle)) { >- ret = PTR_ERR(handle); >- goto out; >- } > if (final_size > inode->i_size) { >+ /* Credits for sb + inode write */ >+ handle = ext3_journal_start(inode, 2); >+ if (IS_ERR(handle)) { >+ ret = PTR_ERR(handle); >+ goto out; >+ } > ret = ext3_orphan_add(handle, inode); >- if (ret) >- goto out_stop; >+ if (ret) { >+ ext3_journal_stop(handle); >+ goto out; >+ } > orphan = 1; > ei->i_disksize = inode->i_size; >+ ext3_journal_stop(handle); > } > } > >@@ -1648,18 +1643,21 @@ static ssize_t ext3_direct_IO(int rw, st > offset, nr_segs, > ext3_get_block, NULL); > >- /* >- * Reacquire the handle: ext3_get_block() can restart the transaction >- */ >- handle = journal_current_handle(); >- >-out_stop: >- if (handle) { >+ if (orphan) { > int err; > >- if (orphan && inode->i_nlink) >+ /* Credits for sb + inode write */ >+ handle = ext3_journal_start(inode, 2); >+ if (IS_ERR(handle)) { >+ /* This is really bad luck. We've written the data >+ * but cannot extend i_size. Bail out and pretend >+ * the write failed... */ >+ ret = PTR_ERR(handle); >+ goto out; >+ } >+ if (inode->i_nlink) > ext3_orphan_del(handle, inode); >- if (orphan && ret > 0) { >+ if (ret > 0) { > loff_t end = offset + ret; > if (end > inode->i_size) { > ei->i_disksize = end;
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 439194
: 306272