]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.25/patches.fixes/ocfs2-fix-regression-in-ocfs2_read_blocks_sync.patch
Reenabled linux-xen and xen-image build
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.fixes / ocfs2-fix-regression-in-ocfs2_read_blocks_sync.patch
CommitLineData
00e5a55c
BS
1From: Mark Fasheh <mfasheh@suse.com>
2Date: Fri, 21 Nov 2008 14:06:55 -0800
3Subject: ocfs2: fix regression in ocfs2_read_blocks_sync()
4
5We're panicing in ocfs2_read_blocks_sync() if a jbd-managed buffer is seen.
6At first glance, this seems ok but in reality it can happen. My test case
7was to just run 'exorcist'. A struct inode is being pushed out of memory but
8is then re-read at a later time, before the buffer has been checkpointed by
9jbd. This causes a BUG to be hit in ocfs2_read_blocks_sync().
10
11Reviewed-by: Joel Becker <joel.becker@oracle.com>
12Signed-off-by: Mark Fasheh <mfasheh@suse.com>
13---
14 fs/ocfs2/buffer_head_io.c | 15 ++++-----------
15 1 files changed, 4 insertions(+), 11 deletions(-)
16
17Index: linux-2.6.27-ocfs2/fs/ocfs2/buffer_head_io.c
18===================================================================
19--- linux-2.6.27-ocfs2.orig/fs/ocfs2/buffer_head_io.c
20+++ linux-2.6.27-ocfs2/fs/ocfs2/buffer_head_io.c
21@@ -112,7 +112,7 @@ int ocfs2_read_blocks_sync(struct ocfs2_
22 bh = bhs[i];
23
24 if (buffer_jbd(bh)) {
25- mlog(ML_ERROR,
26+ mlog(ML_BH_IO,
27 "trying to sync read a jbd "
28 "managed bh (blocknr = %llu), skipping\n",
29 (unsigned long long)bh->b_blocknr);
30@@ -147,15 +147,10 @@ int ocfs2_read_blocks_sync(struct ocfs2_
31 for (i = nr; i > 0; i--) {
32 bh = bhs[i - 1];
33
34- if (buffer_jbd(bh)) {
35- mlog(ML_ERROR,
36- "the journal got the buffer while it was "
37- "locked for io! (blocknr = %llu)\n",
38- (unsigned long long)bh->b_blocknr);
39- BUG();
40- }
41+ /* No need to wait on the buffer if it's managed by JBD. */
42+ if (!buffer_jbd(bh))
43+ wait_on_buffer(bh);
44
45- wait_on_buffer(bh);
46 if (!buffer_uptodate(bh)) {
47 /* Status won't be cleared from here on out,
48 * so we can safely record this and loop back
49@@ -251,8 +246,6 @@ int ocfs2_read_blocks(struct inode *inod
50 ignore_cache = 1;
51 }
52
53- /* XXX: Can we ever get this and *not* have the cached
54- * flag set? */
55 if (buffer_jbd(bh)) {
56 if (ignore_cache)
57 mlog(ML_BH_IO, "trying to sync read a jbd "