Re: [PATCH] FAT fixes (2.3)

Alexander Viro (viro@math.psu.edu)
Fri, 8 Oct 1999 10:06:04 -0400 (EDT)


On Fri, 8 Oct 1999, Alexander Viro wrote:

> The patch below fixes the braino in 2.3 FAT support. Now it
> handles writing behing the EOF correctly. Patch affects only FAT (none of
> the functions is used by anybody else). Please, apply it. It's against
> 2.3.19, but 2.3.20-pre2 doesn't touch files in question.

Aargh... A piece fell out. Sorry, folks. Full variant follows:

diff -urN linux-2.3.19/fs/buffer.c linux-bird.fat/fs/buffer.c
--- linux-2.3.19/fs/buffer.c Sun Sep 12 13:29:57 1999
+++ linux-bird.fat/fs/buffer.c Fri Oct 8 03:59:06 1999
@@ -1512,8 +1512,8 @@
char * target_buf, *target_data;
unsigned long data_offset = offset;

- offset = page->offset-inode->i_size;
- if (offset < 0)
+ offset = inode->i_size - page->offset;
+ if (page->offset>inode->i_size)
offset = 0;
else if (offset >= data_offset)
offset = data_offset;
diff -urN linux-2.3.19/fs/fat/file.c linux-bird.fat/fs/fat/file.c
--- linux-2.3.19/fs/fat/file.c Sun Sep 12 11:56:11 1999
+++ linux-bird.fat/fs/fat/file.c Fri Oct 8 03:59:46 1999
@@ -60,7 +60,7 @@
fat_get_block, /* get_block */
block_read_full_page, /* readpage */
NULL, /* writepage */
- NULL, /* flushpage */
+ block_flushpage, /* flushpage */
fat_truncate, /* truncate */
NULL, /* permission */
NULL, /* smap */
@@ -118,7 +118,7 @@
unsigned long page_cache = 0;
long status;

- pgpos = inode->i_size & PAGE_CACHE_MASK;
+ pgpos = MSDOS_I(inode)->i_realsize & PAGE_CACHE_MASK;
while (pgpos < page->offset) {
hash = page_hash(inode, pgpos);
repeat_find: new_page = __find_lock_page(inode, pgpos, hash);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/