]> git.pld-linux.org Git - packages/kernel.git/blame - linux-2.4.19-truncate-fix.patch
- ported from linux-2.4.25-atmdd.patch
[packages/kernel.git] / linux-2.4.19-truncate-fix.patch
CommitLineData
723fa9aa
JR
1From: Eric Sandeen <sandeen@sgi.com>
2Subject: TAKE - Add buffer to inode's dirty list after truncate()
3To: undisclosed-recipients: ;
4Date: Tue, 24 Sep 2002 16:39:35 -0500
5Lines: 29
6
7block_truncate_page() does a __mark_buffer_dirty(bh) at the end, but it
8does not file the buffer on the inode's dirty data queue, so only
9bdflush can ever get to it, and other sync mechanisms which call
10fsync_inode_data_buffers() do not see it.
11
12This was the root cause of the mapcheck program failing on fsr'd files,
13it found data past EOF as a result of the failed sync after truncate.
14
15This one seems to have the Kernel Gods' blessings, and will hopefully
16be in 2.4.20.
17
18Index: linux/fs/buffer.c
19===================================================================
20RCS file: /cvs/linux-2.4-xfs/linux/fs/buffer.c,v
21retrieving revision 1.109
22retrieving revision 1.110
23diff -u -r1.109 -r1.110
24--- linux/fs/buffer.c 2002/07/25 15:31:36 1.109
25+++ linux/fs/buffer.c 2002/09/24 21:36:23 1.110
26@@ -2028,7 +2028,12 @@
27 flush_dcache_page(page);
28 kunmap(page);
29
30- __mark_buffer_dirty(bh);
31+ if (!atomic_set_buffer_dirty(bh)) {
32+ __mark_dirty(bh);
33+ buffer_insert_inode_data_queue(bh, inode);
34+ balance_dirty();
35+ }
36+
37 err = 0;
38
39 unlock:
This page took 0.174425 seconds and 4 git commands to generate.