]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.fixes/ext4-use-a-fake-block-number-for-delayed-new-buffer_head
Fix oinkmaster patch.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.fixes / ext4-use-a-fake-block-number-for-delayed-new-buffer_head
CommitLineData
2cb7cef9
BS
1From: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2Date: Tue, 12 May 2009 18:40:37 +0000 (-0400)
3Subject: ext4: Use a fake block number for delayed new buffer_head
4Patch-mainline: 2.6.30-rc6
5Git-commit: 33b9817e2ae097c7b8d256e3510ac6c54fc6d9d0
6References: bnc#503161
7
8ext4: Use a fake block number for delayed new buffer_head
9
10Use a very large unsigned number (~0xffff) as as the fake block number
11for the delayed new buffer. The VFS should never try to write out this
12number, but if it does, this will make it obvious.
13
14Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
15Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
16Acked-by: Jeff Mahoney <jeffm@suse.com>
17---
18
19 fs/ext4/inode.c | 6 +++++-
20 1 file changed, 5 insertions(+), 1 deletion(-)
21
22--- a/fs/ext4/inode.c
23+++ b/fs/ext4/inode.c
24@@ -2190,6 +2190,10 @@ static int ext4_da_get_block_prep(struct
25 struct buffer_head *bh_result, int create)
26 {
27 int ret = 0;
28+ sector_t invalid_block = ~((sector_t) 0xffff);
29+
30+ if (invalid_block < ext4_blocks_count(EXT4_SB(inode->i_sb)->s_es))
31+ invalid_block = ~0;
32
33 BUG_ON(create == 0);
34 BUG_ON(bh_result->b_size != inode->i_sb->s_blocksize);
35@@ -2211,7 +2215,7 @@ static int ext4_da_get_block_prep(struct
36 /* not enough space to reserve */
37 return ret;
38
39- map_bh(bh_result, inode->i_sb, 0);
40+ map_bh(bh_result, inode->i_sb, invalid_block);
41 set_buffer_new(bh_result);
42 set_buffer_delay(bh_result);
43 } else if (ret > 0) {